We discuss the modular symmetry and zeros of zero-mode wave functions on two-dimensional torus $T^2$ and toroidal orbifolds $T^2/mathbb{Z}_N$ ($N=2,3,4,6$) with a background homogeneous magnetic field. As is well-known, magnetic flux contributes to the index in the Atiyah-Singer index theorem. The zeros in magnetic compactifications therefore play an important role, as investigated in a series of recent papers. Focusing on the zeros and their positions, we study what type of boundary conditions must be satisfied by the zero modes after the modular transformation. The consideration in this paper justifies that the boundary conditions are common before and after the modular transformation.