While I struggle with the one-and-dones, I agree that there is no way to enforce staying. If a student wants to leave school, they can.
The approach I saw referenced here is the only one that may have an impact and that is enforcing scholarships for a set amount of time; I would say 3 years. If a student leaves after 1 year, the scholarship still counts. While this likely won't stop anyone leaving; schools would have to decide if it is worth it. I would also add that if a student does stay for 2 years, then the scholarship would be released.
Ultimately, I'm just thinking out loud. The NBA can do what it wants, but I struggle with how schools can address it.