The term "Gestapo" is a contraction of "Geheime Staatspolizei", and the last word "Polizei", which is feminine in German, determines the grammatical gender.
Cf also the very beginning of the Spanish Wikipedia entry for Gestapo:
La Gestapo (contracción de Geheime Staatspolizei: 'Policía Secreta del Estado') fue la policía secreta oficial de la Alemania nazi (...)
Added in edit:
Until Until the year 1936 also the term
"Gestapa" "Gestapa" was also in use, a contraction of "Geheimes Staatspolizeiamt", and the last word isbeing neuter in German.