it’s because the nipples (as well as the rest of the mammary cells) are formed in the embryo before sex differentiation begins to happen at five weeks. if an X chromosome is expressed, they’ll eventually become breasts. if it’s a Y chromosome, then all the mammary stuff is still there, it just never turns into breasts.