If you gave the snake a soak there are a few possibilities other than a respiratory infection...

If it were a respiratory infection, you would've noticed some other symptoms a long with it. Crust built up a long the sides of the mouth, and nostrils. Drooling. Inability to breathe with its mouth closed, wheezing, heavy breathing, etc.

A good possibility is that the snake had drank some water, and after being handled from the soak and acting out aggressively, it expelled some. Some of the water may have mixed with the mucus, and other bile, in the throat and stomach, to give you that foamy appearance. You'll have that occasionally when they have a fresh drink, and are recently handled, or move a lot. They'll even drool a bit out, or vomit some out.

What I would do is keep your temps steady at 89-90F on the warm side for now, with the cool end sitting at around 84F. Keep your humidity at around 60%, and wait it out. See if the symptoms persist. If they do, then look into treatment.