I'm not certain why public streets would be gated.
I saw those gated streets 15 years ago when I vacationed in PR- I was going to rent a car, until I found out I would probably get car jacked- don't stop at a red light at night, if there is no traffic coast right on through to avoid car jackers, I was told. OK- I pass on the rental car- a taxi will work for me. Shopping mall parking lots had armed guards in scaffold perches with binoculars to keep thieves from breaking into shopper's cars. Homes regularly had tall wrought iron fences around them- if you want to keep anything safe in San Juan, it has to be fenced and locked up.