It may depend on what type of paint you used. Was it latex or oil? Whether spackling compound was used first shouldn't matter as long as it was primed first. Whatever paint you used, I would be sure to use a good primer first before applying the paint.
From
Latex paint over oil base paint? - Old House Forum - GardenWeb
"Latex goes over oil just fine.
The problem is in getting good surface adhesion since oil (especially older stuff) is often very smooth.
Light sanding or washing with TSP (the real stuff, not the substitute) will provide a good surface for a bonding type latex primer.
Oil over latex is often a problem.
Latex paint is more flexible than oil paint, and putting a hard film over a softer film can often cause cracking problems. At the very least the hard film properties of the oil paint are compromised.
You can make it stick, but if you already have latex it is better to stick with latex.
Some of the newer acrylic paints work as well as oil (alkyd) used to, and even have full gloss formulations now.
They often need a little Floetrol to level out nicely though."