Medical students love shows that are set in a medical environment. Grey's Anatomy, House M.D., Scrubs, Nip/Tuck, Doctor Who - the list goes on. Med students swallow them up like Skittles. In fact, it has been documented that fully 75% of the increase in medical school applications over the past three years is directly attributable to the surge in popularity of these shows. If you're new in the television business and you're desperate to create a hit show, all you need to do is take a bunch of old jokes from other hit television shows, and recycle them into the setting of a medical environment. You don't even need to worry about medical accuracy, since the majority of your intended audience will never even know if you make a mistake.
One reason that med students like these shows so much is that they get to live vicariously through them. Real doctors do silly things like take care of patients and fill out paperwork, but doctors on television shows spend most of their time making snarky comments at each other and having lots and lots of sex. Doctors on television also never have to face the consequences of their actions (unless their real-life actor does something stupid). Watching these shows gives medical students a socially acceptable way to fantasize of doing nothing all day except acting as cool as Fonzie and having unnatural amounts of sex with marginally attractive individuals.
Medical students also like these shows because they give the students a chance to show off how much they're learning in school. This does let them impress people occasionally, but mostly it lets them feel good about themselves. For example, if one of the actors mispronounces a phrase like "bilateral hyperplasia of the adrenal zona fasciculata" incorrectly, they will be mocked for no less than fifteen minutes. A really serious instance of medical incorrectness can be milked for conversation fodder for weeks at a time.
Non-med students also watch these shows, but mostly because of the hot actors and actresses (Katherine Heigl, I'm looking at you) and the ridiculous situations the actors are put into. Overall, these shows have better plot elements and character development than other typical shows like Spongebob Squarepants or Friends, so it makes sense that they've attained mainstream popularity.