It was narrated that Ibn 'Umar was asked about gardens in which excrement was thrown.: He said: "If it has been watered several times, then perform prayer there," and he attributed that to the Prophet.
This hadith also teaches us about cleanliness and hygiene; although we are allowed to pray in a garden with excrement present, we should still strive for cleanliness by watering the area multiple times before praying there. This shows us how important cleanliness is for our spiritual well-being as well as our physical health.