suds & water leaking from bottom

The other day I moved my washer away from the wall to clean behind it. I pushes it back up against the wall and then ran a load, and when I went to put the clothes in the dryer, a big puddle of sudsy water was on the floor under the washer.

I did a Google search and figured that I either pushed the washer up too close to the wall, which supposedly will cause this (but I couldn’t find an explanation of why), or I pushed the hose down into the wall too far, as a video on YouTube said not to put in in farther than 8 inches into the wall. However, it was pushed in farther than 8 inches before.

I pulled the washer farther away from the wall, pulled the drain hose farther out of the hole in the wall, and tried another load, and everything went fine. I did about three or four loads over the last couple of days, and now today, there is another large puddle of soapy water on the floor under the washer. This time, there was also a little bit of foam coming out of the hole that the drain tube goes into in the wall.

I am at my wits end, as we just had a leak under our bathtub and I had another huge water mess to clean up just a few days ago. The plumber fixed that, it was on another side of the house; I don’t think they are related.

What have I done? I just wanted to clean behind the washer, lol, and now it seems I have broken it. Any ideas, anyone? Thanks in advance to anyone who has a few minutes to spare and replies.