One definition of the word, "deny" is to restrain (oneself) from gratification of desires. It's always plesant to be outside, healthy too because your body will naturally make Vitamin D synthesized by sunlight. The most logical reason doctors deny oneself from going outside while on an antibiotic is there's a possibility that a bacteria resistant strain could be born. Methicillin-resistant Staphylococcus aureus (MRSA) infection is caused by a type of staph bacteria that's become resistant to many of the antibiotics used to treat ordinary staph infections. Another reason would be is that the human body would come into contact with other bacteria which could confuse the immune defense system making the antibiotic ineffective.