Oh I concede that I cannot explain all acidities and this increases if we include solvent effects. The acidities measured in water normalize conditions to a degree. Additional substituents add electron withdrawing, vinologous effects, and local environments in ways that are difficult to generalize on. I tried to generalize on a generalization. Your mileage may vary.
An often used explanation that I do not find satisfactory is to use the stability of the conjugate base to explain the acidity of an acid. For example, if we use phthalimide, we could draw resonance structures for the anion in which we place the negative charge on the oxygen atoms. This implies those electrons are somehow participating in the resonance structure. However, I argue the bonding N-H electrons are actually orthogonal to the pi-electrons and thus are unable to participate in the resonance structure. I do not foresee this as a problem. Just as N, O, and F are more electron withdrawing due to a greater nuclear charge, the result is an increase in acidity. Similarly, an sp or sp2-atom, especially if attached to a N or O, will be more electron withdrawing, e.g. HCN (I don't need a resonance structure for the anion), HNCO. Therefore one should expect any of these arrangements should increase the acidity, e.g. phthalimide, pyrrole, cyclopentadiene, acetone, acetoacetate, etc.
I acknowledge that the conjugate base argument may be easier for students to grasp and for that reason may be preferred. However, that does not mean that I must agree with it.