I wouldn't even consider prison to offer "shelter" since you're locked in there with violent people.
a position or the state of being covered and protected
a shielded or safe condition; protection
a place giving temporary protection from bad weather or danger