I used to have the same problem. It is almost always a result of the shell being too thin and/or the crack preexisted. The crack may be a very fine line, barely noticeable to the naked eye. (If it's fine enough, the membrane just inside the shell will hold the liquid at bay.)
If the egg is cracked, it the increased pressure caused by the rising temperature as the egg cooks will almost always cause it to split open, breaking the membrane and allowing the white to begin to escape.
The solution: prick a small hole in the rounder end of the egg before cooking it. You need to do it to the rounder end because this is where there is an air pocket (I call it "headspace") between the shell and the membrane. The idea is to make a hole that goes through the shell, without puncturing the membrane. In doing so, the hole will allow the expanding egg white (and membrane) push the air out of the hole as it heats up. (You will see that happening when you submerge the eggs in hot water.)
I like to use a push pin (repurposed bulletin board tack) and hold it between thumb and forefinger in such a way that no more than about 1/8" of the pin will go into the egg.
I boil about a dozen eggs every week and always take them straight from a 34° F fridge, poke the holes, and put them straight into boiling water. Since doing it this way, the only eggs that leaked were visibly cracked to begin with. I cannot remember the last time it happened. (I gave up experimenting with the cracked ones and use them in other ways if they're not spoiled.)