washer overflow

My Maytag wash machine (Model A 606) overflowed when it got stuck in a rinse cycle. what would have caused this?

A bad water valve could have cause it.