How can a prayer be both valid and disliked?

Prayer in, Around, and on the Roof of the Kaaba