The outlet (waste water) pipe may be partially blocked with 'gunky' old soap powder etc, and not all the water is exiting the machine, leaving 'stale' water inside the machine.
If your outlet pipe is connected to through your sink waste, the pipe may be partially blocked at the connection with the sink pipe. Remove the washing machine pipe at that point and clean out the blockage with an old toothbrush and reconnect.
Richard, May 2006