Visiting Monuments Of Non-Muslims Used For Polytheism
Hadith that you quoted means that if one wants to go for a religious long journey to worship God, then these three mosques are worthy for such a journey. As far as visiting temples and pyramids is concerned, it is not prohibited to visit them. The only prohibition is that of enagaging in polytheism.