Yes, of course he did not contract the flu while he was in the hospital, because he was VACCINATED. But because of the pneumonia weakening his immune system, prior to vaccination he was more susceptible to it, and being in the hospital he could have been exposed to it there. And if he HAD contracted it on top of the pneumonia, it would have been a potentially FATAL combination. People die from the flu all the time when they are elderly, or very young, or have comorbid pulmonary conditions! So the flu shot was necessary and appropriate treatment. These days, it's ordered for any at-risk patient that comes into the hospital during flu season.
When he was admitted to the hospital, he signed consent forms to be treated there, which would have covered the flu shot and all the other treatment that the doctor deemed appropriate, except for procedures which require separate consents like (non-emergency) surgery, so there would not be any battery tort unless the patient verbally told the nurse he did not want the shot before he got it and she gave it anyway. Which again, would not happen, every time I've seen a patient refuse to take a med, the nurse has been MORE than happy to click "patient refused" on the computer and move along to the next room. And even if the nurse had come into the room with the needle and not immediately said what it was, your friend would have asked about it before she got anywhere near him with it, because patients don't like needles. So your friend is not telling you the truth or he is misremembering the details.
By the way, "Youtube and the internet" is not RESEARCH. Read some reputable medical journal articles about the flu shot, with actual scientific studies and evidence. Then read some medical journal articles about the flu itself and what it can do to a person with a compromised respiratory system. And try using your BRAIN instead of allowing yourself to be emotionally affected by alarmist pseudoscience on Youtube.