We study both analytically and numerically the phase transition in the two-dimensional XY gauge glass, which describes superconducting arrays in random transverse magnetic fields. We introduce the modified Villain scheme as an attempt toward more accurate expansion at low temperatures; this leads to random couplings, which originate from the randomness of the ground-state configuration. It is then found via the renormalization-group method that the randomness in couplings tends to suppress the re-entrant transition. We also present results of Monte Carlo simulations, which are in general consistent with those obtained analytically. Finally, the possibility of glass ordering is discussed.