It is conserved (only terms that are overall weak-hypercharge neutral are allowed in the Lagrangian). However, one of the interactions is with the Higgs field. Since the Higgs field vacuum expectation value is nonzero, particles interact with this field all the time even in vacuum. This changes their weak hypercharge (and weak isospin T 3). Only a specific combination of them, Q = T 3 + 1 2 Y W (electric charge), is conserved.