The reason Spain has managed the Covid19 situation so much better than the UK may, in part, be due to their stringent rules. Until recently people could only leave home if they were alone, carried ID and had a permitted reason to travel. If a member of the public was in violation of the current edict, the police, who were out in force checking paperwork, were empowered to fine and send them home.
These restrictions were eased within very strict margines and are now lifted. We in the UK still have a long way to go.