Why do rabbis have beards?

Traditional Answer:

Many Orthodox Rabbis do not shave their faces because the Torah specifies that men are to not shave the 'corners' of their head. So that they don't accidentally violate this mitzvah, they don't shave their faces at all. There are some Orthodox Rabbis that remove or shape their beards, particularly among modern Orthodox Rabbis.

Among Non-Orthodox Rabbis, the practice of wearing a beard is rare (particularly among female rabbis.)

Answer that is not based on Jewish law or custom:

For those that do, it hearkens back to ancient near eastern culture; from ancient times throughout the middle east, a beard was a badge of manhood, and as shaving was not widely practiced until the time of Alexander the Great, many men simply did not shave. Hence, very old men often had long beards, and in the case of scholars and learned men, the longer the beard the greater the authority, because the more years a given man had been a scholar.

It was a cultural habit, that overtime became a cultural tradition across all Semitic groups, and it stayed even as the Semitic within the Jews of Europe was diluted. Among Jews, secular or religious, again a beard is a badge of manhood; you can hide behind immaturity for so long while you can't grow a beard, but, once it comes in, there is no hiding that you're not a youngster anymore, you're a man, that is the attitude among Semites, Jew or Arab.

In Judaism, as a sort of "throw back" to more ancient Semitic culture, the beard is revered, but it is also a source of angst for the immature male, especially in Israel. The youth feels oppressed by his bearded elders while longing to have his own beard that can't seem to come in fast enough.