Use joint compound for large patches or lightweight spackle for smaller ones. These are much easier to sand smooth than vinyl spackle. Make sure the patching material is extended past the patch itself so it can be sanded to blend into the wall.
Sand the patch completely flush with the wall using either a sanding sponge or a drywall sander instead of just holding a piece of sandpaper with your fingers. Using a flat, semi-rigid sanding tool prevents ripples in the surface of the patch. Run your hand over the patch; it's easier to feel whether it's flat than to see it.
Prime the patch using a roller instead of a brush. A 3/8- or 1/2-inch nap lambswool roller cover will give you a little more stippling texture. Expect the primer coat to dry fairly flat because it will be absorbed into the porous patching compound. Let it dry for at least 1 hour.
Roll a coat of paint over the primer and patch, and let it dry. Shine your light on the area to see if it now matches the surrounding painted texture. If it does, paint the whole wall.
Thin a little joint compound or lightweight spackle with water if the patch is still too smooth. Stir the mixture until it has a thick, soupy texture. Use a sponge to dab it lightly over the patched and painted area. Use a light touch because it's easier to add more texture later than to wipe it off and start again. Extend and feather out the sponged texture onto the surrounding wall, dabbing until it matches the existing painted texture.
Prime the area, and paint the entire wall using the lambswool roller for a consistent texture.