If you have well water and it smells like rotten eggs, it is probably due to sulfur. It could be caused by bacteria in the machine. If this is the case running it empty with hot water and bleach will fix the problem.
The water coming out of your washing machine is not actually causing the smell. It is the water in the sewer lines that is backing up due to poor flow when your maching drains. They make chemicals to help clean the lines, but I have not had much luck and would recommend calling a plumber.
The water from a washer machine is called grey water and without proper venting on the drain line the water could have a smell. A call to a plumber could solve your problem.
That may be due to the your washing machine being poorly designed and trapping water in places it can't dry. This buildup of water attracts and generates mold, which would account for the smell.