Believe it or not, one of three tracks at UTMB in Galveston in preventative medicine is a specialty track in "corrections medicine".
http://www.utmb.edu/cmc/Publications/articles_press/ProgramAward.asp
Now, yours is an interesting question, because, traditionally and stereotypically, "prison docs" have been those that REALLY can't speak English, docs who have lost their licenses for having sex with patients or felony convictions, and only get the license back under the condition of working in prisons, or those that REALLY don't give a damn, and are just "biding their time". In reality, some-to-much of that is true, but, also, there are some that have their hearts in it.
The money isn't great, because you're a state employee. There is also the risk of assault or injury from inmates, although this is minimized for a few reasons: first is that, depending on the inmate, they will be immobilized/restrained as needed to protect you (including a club-wielding CO (corrections officer) at arm's length), because, if they lose a doc, the doc is VERY hard to replace. Another reason is that the infirmary is "holy ground" or respite for most inmates, so, they won't bite the hand that feeds them.
On the other hand, malpractice? Good luck with a prisoner lawsuit. Even if you suck at your job, as long as you are not egregiously wrong (or, even if you are), you're essentially bullet-proof. You can do whatever the heck you want, and it's OK. However, if you are diligent, it can be frustrating not being able to do the best possible for the patients.
Also, lots and lots and LOTS of HIV/AIDS and TB. Also, you may come face to face with the sickest, meanest, most vile and evil people on the face of the earth.