can you legally refuse hep B vaccine at birth?

I've read that hospitals won't let you be discharged until your baby has the hep B vaccine. I don't understand why baby even needs that. He's not at risk. Can you legally refuse the shot? Any insight would be helpful! FTM