Most government schools receive funding based upon attendance. If students don't show up for class, the school gets a smaller check from the state and federal government. And since a school can lose thousands of dollars if a student leaves school, slackers and trouble makers are rarely expelled. Unless, of course, they have guns. In the free-market, private schools strive for high test scores and high graduation rates.
Attendance is important only if a student is performing poorly.
Most college professors at private colleges never take attendance. In a Libertarian society, all schools would be private and, like many college students, you could sleep all day and study all night.