People were seen fleeing from the BH Mallorca Hotel in Magaluf after smoke and flames began pouring from a second-floor window on Sunday.
About 100 guests were evacuated after one room and several areas nearby became engulfed.
On Tuesday, two men aged 21 and the two women aged 19, who have not been officially named, appeared before legal officials.
All were released on bail but were told their passports would be returned once they had paid €30,000 (£26,000).
Spanish authorities have estimated the cost of the damage at £175,000.
Spanish newspaper ABC said the fire had started as a result of bungled prank.
Someone in the flat had tried to burn the feet of a friend using a lighter and an aerosol can, ABC said, quoting Spanish police, and the mattress caught fire.
The fifth person in the flat at the time, who was the target of the prank, was asleep.