Initially there were mathematical reasons why people suspected that all boson needed to have 0 mass as is the case for photons a gluons, see Goldstone's theorem.

So people started theorizing some hack that would fix up the equations, and they came up with the higgs mechanism.