Sausage exploded and looks foamy
That foam is perfectly natural.

The foam is the result of meats natural protein composition. If you've ever poached eggs, or boiled lobster, or cooked a stock, you'll know that the water can become a little scummy. If you leave the pot on, that scum makes a white-ish or grey-ish foam that forms lovely looking rafts. That foam is made of water soluble protein.

In your case, you have wet sausage meat in a case. A small amount of that meat's proteins, mostly sarcoplasm and myoglobin, are going to escape from their cells and into the meat juice.

When the sausage case breaks, that juice, a mix of water and protein, is escaping into a hot oven, and the proteins are going to spontaneously denature, forming a foam much like scrambled eggs.

If anything, you should be happy- water soluble albumin foam is a sign that the sausage is full of proteins, and is definitely made of meat, and not, say, recycled chipboard. 

Enjoy the sausages!