Baby’s last name

Why do you give your baby their fathers last name instead of yours? Especially if y’all aren’t married, in my opinion I feel like if we aren’t married and I so happen to get pregnant my child should have my last name but to each it’s own