Because mosque is a feminine noun in Spanish.
Thats's "mezquita"