We have Whirlpool Duet front load machine. Lately
Water filling in the tub when not in use can be caused by two things. A leaky inlet valve or back flow from the drain caused by siphoning, or poor drainage. I have a link under my "Tips and Tricks" that explains siphoning, if you wish to refer to it. If the water was coming from the drain, though, it would probably be dirty water. A simple test you can try is to turn both water taps off before going to bed. If the tub is empty in the morning, then you know you have a leaky water inlet valve. If the tub fills with the water shut off, the problem is drainage.
If you determine that the water inlet valve (also called a mixing valve or fill valve) here's some info. The valve has electronically controlled solenoids with a small diaphragm that closes the valve when not in use. If the diaphragm is damaged, corroded, has sediment stuck in it, or if your water pressure is too low, these valves will leak by. If you've never had a problem with water pressure before, I would assume the water inlet valve is the problem. You can attempt to remove it and clean it if you like, or....if you're going to go through the steps to remove it, just replace it.
If you decide to clean it, follow these steps:
1. Unplug the washer and turn the water source off.
2. Disconnect the inlet hoses.
3. Remove the washer top panel by removing the three screws that hold it in place in the rear of the unit. With the screws removed, the panel will slide back, then off.
4. Locate the inlet valve on left-hand side rear of the washer (as viewed from the front.
5. Remove the the dispenser hose and electrical connections.
6. Remove the mounting screw(s) and the valve is out.
Soak the valve in 50/50 mix of distilled white vinegar and hot water, leaving the electrical connections out of the solution. Keep them dry. Allow to soak for 30-40 minutes and flush with water.
If the valve works, great. You just saved yourself the cost of replacing it. If it doesn't, you can order a replacement valve on line at searspartsdirect.com, appliancepartspros.com, or repairclinic.com. If you do not wish to order on line, look up the part number on the Sears website and go to your nearest appliance parts retailer. This is a common part that most retailer will carry in their store inventory.
If you have questions, please let me know. I hope this helps you.