If $Y$ is a complex projective algebraic variety, the Picard group $\operatorname{Pic}Y$ has the structure of an algebraic variety; if $X$ is another algebraic variety, any line bundle $L$ give a regular map $X \to \operatorname{Pic}Y$ by sending $x \in X$ to the class of $L \mid x\times Y$. If $L$ is 2-torsion, then the map $X \to \operatorname{Pic}Y$ has image contained in $\operatorname{Pic}(Y)[2]$; but $\operatorname{Pic}(Y)[2]$ is finite, so if $X$ is connected, the map has to be constant.