When Windows just won’t stay in sleep mode there’s a simple fix. First you need to identify which component keeps bringing Windows out of sleep mode.
To do that, open the System event log and find any events from source ‘Power-Troubleshooter’ that indicate that the system has returned from sleep mode - similar to this:
In my case, the network adapter was the problem. I think my router is sending some weird packets around the network. I can’t fix the source of the problem (it’s a pretty basic router), but I can configure the network adapter to prevent it from waking the computer.
Open the properties of the adapter in Device Manager and either untick ‘Allow the device to wake the computer’ or tick ‘Only allow a magic packet to wake the computer’ and the computer will stay in sleep mode.