The brain is programmed to seek what makes it happy. For some people that's sex, good food, or living with 50 cats.
Women that have experienced intense sexual pleasure think about sex more often than women who haven't. It's easier for men to experience sexual pleasure, therefore men on average think about it more.