In the electroweak theory SU(2) transformations commute with U(1) transformations by definition and therefore U(1) charges for the elements of the SU(2) doublet (for example lefthanded up and down quarks) have to be equal. This is why U(1) cannot be identified with U(1) em and weak hypercharge has to be introduced.