Almond milk: pasteurize almonds and water before sealing?
In the US, most almonds are already pasteurized, even when they are listed as "raw". One of the methods is to steam blast the nuts, which heats up the outside of the almond to 205°F (96°C). However, this process is mostly done because of Salmonella concerns, rather than the yeasts and microbes that cause the souring of the milk. You could do something similar by blanching the nuts in boiling water for a few seconds before you soak them.

You could also try soaking the almonds for even less time, I've found that 12 hours or overnight will do the trick, rather than the 2 days you mentioned.

Some producers of almond milk also "ultra-pasteurize" the liquid by heating it to a temperature of 280°F (138°C) and cooling it down quickly before packaging but getting to that temperature is hard to accomplish in a home kitchen. You could try heating to 162°F (72°C) for 15 seconds after you've collected all the liquid, though be sure to have a plan to cool the milk down quickly afterwards.

Exposure to oxygen, yeasts and microbes are predominately what causes the spoiling. The oxygen can rancid the fats in almonds, molds can grown on the surface, yeasts can start to ferment the liquid, and other spoiling.