“We have to alter this system which is inefficient and under-financed and often cruel to the people who are only seeking a better life,” Francisco Fernandez Marugan told a parliamentary commission.
The rights defender listed “major deficiencies” at police stations, reception and detention centres.
Immigrants can spend 72 hours “in cells which rarely have natural light hardly ever running water,” he said.
Fundamental rights could not be sacrificed on grounds of urgency or efficiency, Marugan said, citing the case of the Archidona prison near Malaga which was used a holding centre for several weeks at the end of 2017.
Algerian migrant Mohamed Bouderbala killed himself there after being kept in solitary confinement for 16 hours, sparking public uproar.
At the time Interior Minister Juan Ignacio Zoido said the 36-year-old was among 12 people who stirred up a “mutiny”.
The national police, which was in charge of the centre, “is not trained to look after people who have been deprived of their freedom for 60 days”, the ombudsman added.
Some 28,350 people entered Spain illegally in 2017 — 22,000 of them by sea, according to official statistics. The previous year saw 14,000 illegal entries.
Spain is the third busiest gateway for migrants arriving in Europe, but well behind Italy and Greece.