There are several possible causes. Let's play
House and go through the differential diagnosis.
First, the foamy bottles could have picked up a bug. I think that's unlikely; usually, if one bottle has a bug, all the bottles are infected. But you should still detail your sanitation process to rule it out.
Second, the flat bottles could have been sealed poorly. Do you use a bench or hand capper? Pry-off or twist-off bottles? Swing-tops?
Third - and this is the one that explains all the symptoms - bottles do that sometimes. You're relying on an unknown amount of yeast to ferment an unpredictable amount of sugar with uneven fills. There are lots of variables here. Let's get a more detailed patient history.
Did you bottle all in 12oz longnecks, or did you do like most new brewers and use a wide variety of bottle sizes?
How did you dissolve the priming sugar into the beer?
How did you store the beer for its month of bottle-conditioning? In detail, describe the environment in which it was stored, including temperature and other conditions.
If my diagnosis is correct, the carbonation should eventually even out. Might take another few weeks in the bottle, but the gushers should settle and the flats should come up. But in order to confidently stand behind that diagnosis, I need that history.
Be quick, or I send in Chase to get spinal fluid.
Bob