It’s the only way.
I'd much rather teach and talk and enjoy with my students, but, alas, the design of most universities box us in at different levels (and let's not even get started on the "must publish research" side of teaching).
Just my $0.02.
It's far from perfect, but it's better than the alternatives, and various organizations and people and powers-that-be reasonably want some kind of measure of whether someone actually learned something in a class/degree.