In particle physics, fundamental forces are generated by the exchange of virtual particles (I have been reading a quantum field theory textbook for the last few months to try to understand precisely what this means, among other questions, but this is accepted fact in the field). The Coulomb force comes from the exchange of photons. So this 1/r^2 argument for intensity leads to the Coulomb force falling off like 1/r^2.
This argument doesn't obviously apply to gravity (though presumably it would for a quantum theory of gravity), but the equations for gravity (general relativity) give the same result.
At a higher level, it turns out that when you try to combine quantum mechanics with special relativity, the resulting theories are highly constrained. It's not like classical mechanics, where you can just say 'suppose there's a 1/r^12 force.' You get mathematical inconsistencies if you stay too far. Weird stuff
This argument doesn't obviously apply to gravity (though presumably it would for a quantum theory of gravity), but the equations for gravity (general relativity) give the same result.
At a higher level, it turns out that when you try to combine quantum mechanics with special relativity, the resulting theories are highly constrained. It's not like classical mechanics, where you can just say 'suppose there's a 1/r^12 force.' You get mathematical inconsistencies if you stay too far. Weird stuff