Pooping aside, he may have paniced, and inhaled water then.
Most ball pythons won't drown in 2 inches of water, so there may have been another issue. Was the water hot? Was he just a hatchling? Had he eaten for you?
Always supervise all pets, especially in unfamiliar situations. When I've soaked snakes, they are normally in the container right beside me at the computer, or I use wet towels, so they can't drown.
Sorry to hear about your pet, hugs!