So sorry for your loss. I always thought that cats search for a safe place when they get injured. For example after a traffic incident, when they can still walk, they try to get to safety. Maybe your cat did something like that and this was a comfortable place for him.