The case is one of several being fought by Deliveroo and other gig economy groups like Uber in various countries over whether drivers should be classified as employees.
It was brought by the Spanish social security system, which claimed 1.2 million euros ($1.3 million) in unpaid contributions.
The court in Madrid said the workers were "subject to a work relation" with Deliveroo, which allows people to order from local restaurants online and have it delivered to their office or home by bike couriers.
In a statement, Deliveroo said it would appeal, stressing it worked with "independent" couriers because "it is this type of work that allows them the flexibility and control that they want over their activity."
They "can choose... when, where and whether they want to work."
But for the judge, "the main thing is that once the order was accepted, (the courier) had to attend to it by following detailed instructions determined by the company, with no appreciable margin of worker autonomy."
Deliveroo for instance sent more experienced couriers to ride with novices in their first deliveries to "teach them the mechanics of the service," the judge said.
The case originated from a health and safety report ruling that more than 500 Deliveroo riders operating in Madrid between October 2015 and June 2017 should have been contracted as employees.
Self-employed contractors have to pay their own social contributions to the health and pensions systems.
Employees, meanwhile, have such contributions transferred directly by their employer, which pays a portion of them.
In a similar ruling in June, a court in the eastern city of Valencia also found that Deliveroo wrongly hired 97 riders as self-employed contractors.
Two other similar trials will take place this year in Barcelona and the northeastern city of Zaragoza.