Let us start with $U(1)$ electromagnetism and see why it does not have such interactions. The field strength tensor is given by $F_{\mu\nu}=\partial_\mu A_\nu - \partial_\nu A_\mu$, and the relevant part of the QED Lagrangian is proportional to $F_{\mu\nu}F^{\mu\nu}$. This means that the Lagrangian has only terms that are at most quadratic in the gauge field $A_\mu$. Therefore, as follows from Feynman rules, you cannot have more than two photon lines joining at a possible interaction vertex.
In the case of nonabelian gauge theories like $SU(2)$ and $SU(3)$, the field strength is given schematically by $F^a_{\mu\nu}=\partial_\mu A_\nu^a - \partial_\nu A_\mu^a+g\;\epsilon^{abc}A_\mu^b A_\nu^c$, where I have included indices for the nonabelian symmetry transformations, and g represents a coupling constant. The additional term appears due to the nonabelian nature of the gauge group; it can also be written in terms of a commutator. As you can now see, squaring this term gives rise to fourth powers in the gauge field. This means, again according to Feynman rules, that vertices with four gauge-boson-lines are possible.