As a foreigner I have always found the expression 'rompere le scatole' to be very funny. I know its meaning and I was wondering where it comes from.
As egreg has noted, scatole is currently used as an euphemism. There are other expression that use scatole as a replacement for testicles, like 'averne piene le scatole' or 'andare fuori dalle scatole'. Here, here, and here you can find references. However, I am not sure about the origin of the expression. Maybe it was not strictly linked to the meaning 'testicles'.
The expression was already used in the XIX century. The following quote is from Primiero, Antonio Prospero, Philippe Joseph Simon, and Badon Edmond, I figli della calunniata. Dramma in 5 atti, 1844.
Ast. Andiamo, già fra vicine ed amiche...
Raim. Fra vicine ed amiche già... ci possiamo rompere le scatole tutto il santo giorno, non è vero?
The only info I could find on the net (here and here) seem to point to the fact that during WWII, "to break the boxes" would refer to take ammo from their carton boxes, that is, an attack was imminent. It would be very cool if it was true, but both links lack any real source, so "caveat lector" ;)
I remember my grandpa told me it has something to do with the tin pan that was used to cook the eggs for breakfast, which was also called "scatola". They would crack the egg smashing it slightly to the edge of the pan. So it would be a "scatola" that breaks the eggs, or "rompe le palle". Does it make sense?