A tetragonal photonic crystal composed of high-index pillars can exhibit a frequency-isolated accidental degeneracy at a high-symmetry point in the first Brillouin zone. A photonic band gap can be formed there by introducing a geometrical anisotropy in the pillars. In this gap, gapless surface/domain-wall states emerge under a certain condition. We analyze their physical property in terms of an effective hamiltonian, and a good agreement between the effective theory and numerical calculation is obtained.