Why is it not i?
"På" gives the feeling of 'institution', in general: arbeta på bibliotek (library), på sjukhus (hospital), etc. You could say 'i' but that gives it a much more specific feeling, that you are beginning to talk about a specific prison.
Why is it not: på fängelse... I mean why you need 'ett' here?