[
Donkeys carry lungworm so I wouldn't keep any livestock with one.
So do several other types of animal,
if they are not wormed. Donkeys are easily wormed and as suggested, make a good companion for a ram if suitable sheep isn't available. Our ram has lived quite happily with our donkeys.
However, in answer to the original question - I personally think your ram would be happier outside, but if there's nowhere suitable and he has company, then I'm sure he would be ok inside for a while.