Here are the things I would check first:
1. Have you installed any fun_plug or 'hacked' the unit in any way? If so, remove it and see if it solves the problem. If it does, then you likely have scripts, etc. running from the disk so it never shuts down. The solution is to change your scripts so they are first copied to the ram drive, then executed from there.
2. If you have not done any fun_plug, etc. then try to reset the unit to factory settings and see if it solves the problem.
3. If factory reset didn't solve it, Maybe a hard drive compatibility problem? Test with a different HDD to see if it sleeps
HTH