They should make the material interesting enough that people won’t have to resort to other stuff
Nope. It’s all relative. Compared to what’s available via the phone and internet, 90% of school material is fundamentally more boring, because important things are often boring – and there’s almost nothing you can do about it. I mean sure, an incompetent/unmotivated teacher can make the material even less interesting, but that’s also why we need competent teachers. That’s a separate problem.
So the quest to make school material more interesting than the Internet is a dead end – it’s just impossible. So they need to make everything else less interesting. Which means that phones and computers can fuck right off. If there are kids for whom this is a difficult situation and they’re unable to cope, such kids will need intervention. I.e. restrictions in free time as well.