Washing machines like to shimmy around when in operation. If its super tight it might start banging into the sides of the cupboard. Vibration foam may make it worse but it effectively will mean it it always touching and vibrate your whole house up. How much clearance have you got?
The machines fit! Just!