The 7 teens who entered Ray Allen's Florida home while his wife and children were asleep inside SHOULD HAVE been arrested ... so says the Coral Gables City Attorney who tells TMZ Sports he's gunning to change the laws so he can lock up trespassers in the future.

The backstory is crazy ... the teens were partying at a nearby home last week when they decided to waltz into Allen's home because they thought he was in Cleveland with LeBron James.

When they got inside ... after opening an unlocked door ... they were confronted by Allen's wife who screamed at the group to leave. So, they did.

Cops were called and officials found the teens -- who allegedly admitted to trespassing. Problem is ... because of the way the law is written in FL, cops couldn't arrest them.