Does it make sense to choose a university solely to take classes with one professor who is renowned in your field?
It depends on the situation. When I first answered this question, I was thinking of situations in which someone chooses a particular person as a mentor, and applies to the institution. I have known people who have done this - I was focussing on personal experience.
However, after reading Justin Ausanka's comment, I have to agree that these situations are not typical, and are probably not the kind of situation the OP had in mind.
Yes. This is particularly common for postgraduate students. You think of the person you would like as a supervisor, and make contact with them. If they are willing to take you on, that's where you go. If you are studying for a Ph.D., a good relationship with your supervisor is essential. I've also known this to happen at undergraduate level - I know several people who applied to a particular Oxford college because they wanted to have a particular person as their tutor.
Of course, at undergraduate level, you won't be taught entirely by one individual, and in some cases, the distinguished professor whose work you admire may be a remote figure, with whom you have very little contact. But then a really good professor is likely to be part of a good department. Many students base their choice of university on factors that are much less sensible than this one.
My Second Thoughts:
Justin Ausanka suggested: "Choosing to give a university $150K for a 4 year (or other) degree to take one class with one professor is asinine." This is true. My assumption would be that someone who chooses a university because of one particular professor hopes to major in the subject the professor teaches, and intends to take more than one class with that professor.
Even so, there are some questions you should ask yourself: are you sure the professor will stay at that institution? How much contact time do students get with professors? I suggested that good professors, the ones whose presence would make a university worth joining, are usually to be found in good departments, but don't take this for granted. Why do you want to take classes with this professor. Is it because you saw them on television and want to study with a celebrity? Bad idea. Or was it that when you were sixteen, you read a book this professor wrote about Persian history, and that inspired your obsession with the study of Persian history, which has become your main interest in life? In that case, I think it is entirely reasonable if the decisive reason for choosing a particular institution is the desire to take classes with a particular professor.