How important is it for a professor to direct a thesis? How important is it for a professor to direct a thesis?

I mean, what can the professor get from it? I know it will help for his/her curriculum, but is it too much?

Is the merit equivalent to the publication of an article?

or is it not so important?

or is it more important than the publication of any article?

I am just curious about it.

Thank you.
Advising a bachelor or master's thesis is just part of my teaching obligation. Most of the time it is an enjoyable obligation: now I get to accompany someone on their first steps in doing independent research. However, that is pretty much all I get out of it. Advising a PhD thesis is a bit more prestigious, but the added value drops quickly. However, with a PhD project the advisor may get one or two co-authored papers out of it, and in some disciplines the PhD students are an important source of cheap labor.