I'm not sure why I see people treating banning smartphones in class like child abuse or something. The only explanation I have is that it's a cultural thing. Obviously, if used appropriately, a smartphone is a valuable tool, but this is only if they are used appropriately, which some students will do and some won't (and this varies as well from school to school and class to class). Where I went to school, a significant number of students did not use them appropriately during class, so not allowing them made sense since they distracted from the lesson.
So, why do I have so little confidence that they'll be used properly? Some people are posting anecdotes about their time as teachers in this thread, so I'll post one from the student's perspective. Despite smartphones not being allowed in my classes in high school, people used them anyway. Why? The teachers wouldn't notice, or some might just not say anything. I played the heck out of one mobile game with my friends in both of my history classes, and nothing ever happened. I knew people who'd be listening to music during class too, and completely ignore the lecture itself. Almost everyone with a phone out used it as a distraction from class, not as a tool to help them learn. Despite there being a rule against them, I'd estimate more than half of the people I went to school with used them during class anyway.
So why didn't the teachers enforce it more strictly? My guess is because it wasn't safe. Many of my friends carried knives at school for self defense. There were a lot of violent students, ranging from fights in the hallway to students being part of a gang. To be clear, this wasn't by any means the majority of the student body, but it wasn't an insignificant portion of it either.
The violence escalated dramatically after the 2016 election, where students (who were understandably upset about the result) got up and threatened all the white people in the school. I had graduated by then, but I knew people who had to barricade themselves in a room with a mob of angry knife-wielding students on the other side of the door. Many of the students in the room weren't even old enough to vote. One teacher left the school because of all the threats she'd received.
Also, not sure how common it is to have a "senior prank day" at other schools, but we had one every year. The "pranks" ranged from spray painting threats to teachers on the outside of the gym, to destroying school property. Once they had to put classes on pause while a company came out to replace the locks on all the doors since the "prank" was to destroy the locks so the doors couldn't be opened.
This school was pretty tame too, compared to some of the schools I'd heard stories of. One teacher I talked to at a different school had stories about all the times some student threatened her or pulled a gun out on her or whatever, and it honestly just sounded like hell.
Anyway, I wouldn't say I blame the kids for this behavior, and while I have strong opinions against feed-driven social media, I don't think it was a major contributor to these behaviors (this was before social media was as big as it is now). I think it really comes down to parenting, whether the parents are just bad at raising kids, or they don't have time or resources to properly raise their kids, or their kids have needs they don't know how to (or refuse to) satisfy. Regardless, a teacher can only do so much, so rather than trying to correct behaviors in students at the risk of their own lives, I think a lot of them just put up with it for the sake of the students who do want to learn.
So if the rule is going to be broken anyway, why have a rule against smartphones? It sets the expectation of students regarding smartphone usage, and gives teachers an opportunity to enforce that rule when they feel it's appropriate (and safe) to do so.
Edit: I should also add that I don't think most schools are this violent. This school was exceptionally bad, but it wasn't as uncommon as you might think to have a school this violent.