What are the ethical arguments for and against jail / prison as a means of at least keeping the person out of society?

What are the ethical arguments for and against jail / prison as a means of at least keeping the person out of society?  How much focus do you believe should be on keeping society safe vs. rehabilitating offenders?

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now