Sleeping with you provides them with security and an extra defense if a predator should launch a nighttime attack. They sleep with you because they trust you, they know you're not a danger and you can also provide an extra layer of defense if needed.