Because the sentence is talking about what a specific thing possesses or contains.
So:
Both are possible, but they express the idea differently.
In Spanish, word order is often more flexible than in English, especially in questions.
This sentence could also be:
That is also correct and may sound more straightforward to English speakers.
The version ¿Por qué tiene cloro la alberca pública? puts the subject after the verb, which is very natural in Spanish, especially in questions.
Alberca means swimming pool in some varieties of Spanish, especially in Mexico.
A learner should know that different regions may use different words:
So la alberca pública means the public swimming pool.
No. It is understood in some places, but it is especially associated with Mexican Spanish.
If you want a more widely recognized word across many countries, piscina is often safer. Still, if your Spanish is focused on Mexico, alberca is a very useful everyday word.
In Spanish, descriptive adjectives often come after the noun.
So:
That is the normal word order here.
Yes, that is the literal structure:
So the literal meaning is Why does the public pool have chlorine?
Depending on context, a more natural English translation might also be Why is there chlorine in the public pool?