With my scientist hat on, I wouldn't say that it is beneficial for your health, but as an emergency short-term solution in a desert, it might keep you alive. (Sitting in a prison cell is not an emergency, dehydration scenario...)
Pee is about 95% water, but the other 5% is urea and excess chemicals/minerals in your body that your excretory system (kidneys etc) are filtering out from your blood. So drink pee for a lengthy period and you're just putting those excess chemicals back into your body again.
I know some people claim wonderful health properties from drinking pee, but the science doesn't stack up.