I have never had to present ID to visit someone in a hospital nor have I ever had my photo taken for the purpose of an ID tag to wear while I visit. Having said that, I consider myself lucky that I have rarely visited people in the hospital.
You have to get past the nurse's desk first and you're not going anywhere without their OK.
--------------------------------------- added after 99 seconds
… and since I have never spent a night in the hospital since I was born, I have never had anyone visit me in the hospital (knocking on wood).