MADRID — Ángel Castillo once worked as a restaurant cook. But after losing his job and struggling with alcoholism, he has been sleeping on the streets for most of the last 16 years. It has been a while since he has worked in a restaurant, let alone eaten at one.

Yet there he was one recent evening, among the diners who crowded into a new restaurant in Madrid. It was a simple space, with red-tiled walls and paper napkins, but there were tablecloths, chandeliers and water glasses, and even someone to serve you.

“It’s special to get your food in a restaurant,” Mr. Castillo said, satisfied.

The restaurant is one of four named Robin Hood that opened in the last month in Spain to serve those who cannot afford to dine out.

The minichain’s novel business model is not to steal from the rich, but rather to use revenues made by serving breakfast and lunch to paying customers to cover the costs of preparing free evening dinners for homeless people.