Schools don't necessarily have to be a problem. My kids go to a school that runs right the way through from nursery up to 18 years old. Probably around 1800 kids in total at the school. I think in the 2 months or so they've been back, they've had to send an entire class home for 14 days on 3 occasions. Other than that, there have been isolated cases here and there (including one of my kids' form teachers), but they assess each case on its own merits, decide who the person concerned has been in close contact with, and send those people home to isolate if necessary.
Touch wood, everything they're doing so far seems to be working. Kids are all dropped off at the gate, no parents allowed onto the site unless they have a good reason. Staggered entry and exit times at each gate to ensure there's never more than one year group waiting at any gate at any time (helps that with it being such a big school there are 6 different gates). Older kids have their temperature taken on the way in. Masks compulsory for everyone (with the possible exception of the kids in nursery, I'm not sure about them). Anyone with symptoms is asked to stay home, and anyone developing symptoms at school taken to a special room, with their parents asked to pick them up immediately.
When the schools went back in mid-September, the number of cases per 100,000 people in Madrid was up above 700 (and from memory, from the area where I live, I think it was around 450). It's currently around 270 in Madrid as a whole, and 285 where I live. Obviously that's also down to other measures taken by the Madrid government, but there's no reason why schools being open needs to be a problem (or at least, why schools being open needs to be a bigger problem than shops, bars, restaurants, etc. being open).