This was opened in 1616 exactly 400 years ago.

I'm sure there was poverty in Constantanople or whatever it was called back then but that didn't stop the Sultan from building this!!
Also, try to imagine how many kuffar gazed upon it and converted or atleast became interested in Islam? Islamic architecture is very beautiful and inspires people and We should celebrate Islamic architecture to the fullest.
I agree though... you can't build that without having basic things like water,education,food and shelter infact, many things come before that. A gigantic beautiful mosque/monument is on the top of the hierachy of needs pyramid.