You should always wear gloves too! I always give med students crazy eyes when they walk into a room and palpate cellulitis or start touching and palpating a patient with obvious contact precautions or nasty fungal infections without wearing gloves.
Residents are a lot better at it, maybe because the attendings emphasize it or because by then they've seen one of their buddies get mrsa on their nose or under their eyes after subconsciously scratching an itch after touching a contact patient.
To answer the original question: If you've had a fever within 24 hours of a shift, you are supposed to call out (I think that's Joint Commission guidelines, but not sure). But I imagine that medical students often come in when they are sick to make that good impression, and I imagine residents/attendings often do the same because they don't want to be the reason why their colleague got called in.