It is hard to say why since age, gender, and whether the cat is spayed or neutered can affect the cat's behavior. Young cats, and many older ones, will do this for comfort and/or attention. Perhaps playing with your cat more and ensuring that he has his own furniture and bedding can help. Making sure he has access to a window overlooking an area of activity can help as well. Sometimes cats feel lonely and sad. They need your attention as much as you need theirs.