Excreting urea helps in maintaining internal homeostasis by retaining water.
The mammals like humans excrete urea, while reptiles and birds, and some terrestrial invertebrates generate uric acid as waste. Generating uric acid in place of urea is beneficial as it is less toxic and diminishes water loss and the subsequent requirement for water.
This retention of water helps birds and reptiles to sustain internal homeostasis mainly in hot weather.