The 24-year-old has been charged with crimes including arson, making threats and resisting arrest over the December 16th incident in Barcelona's Sant Martí district.
His 20-year-old girlfriend was also detained after she reacted violently to the arrest of the man, Catalan daily La Vanguaria reported.
Fourteen people were in the warehouse when the building was set on fire, the daily said. Most were able to leave via the building's doors without suffering injuries but five people were trapped and took refuge on the roof, eventually being rescued by firefighters.
One woman was treated by medical staff for a twisted ankle.
Locals said the migrants paid €40 ($50) a month to a local family to live in the property, although that family did not actually own the warehouse.
According to Spain's 20 minutos newspaper, the man arrested by police had visited the property on Tuesday demanding the monthly rent be paid.
When the building's inhabitants refused, arguing it was not the end of the month, the man allegedly threatened to burn the warehouse down. He is then said to have returned with five other people at which point he set fire to paper and cardboard boxes.
On being arrested, the man shouted racist insults and smashed the window of a police patrol car.