Recently, square-net materials [space group (SG) P 4/nmm] have attracted lots of attention for the Dirac semimetal phase with negligible spin-orbit coupling (SOC) gap, e.g., ZrSiS/LaSbTe and CaMnSb2. In this work, we demonstrate that the Jahn-Teller effect enlarges the nontrivial SOC gap in the distorted structure (SG P nma), e.g., LaAsS and SrZnSb2. Its distorted X square-net layer (X = P, As, Sb, Bi) resembles a quantum spin Hall (QSH) insulator. Since these QSH layers are simply stacked in x direction and weakly coupled, three-dimensional QSH effect can be realized in these distorted materials, such as insulating compounds CeAs1+xSe1−y and EuCdSb2. Our detailed calculations show that it hosts two twisted nodal wires without SOC (each consists of two noncontractible T I-protected nodal lines touching at a fourfold point), while with SOC it becomes a topological crystalline insulator with symmetry indicators (000;2) and mirror Chern numbers (0,0). The nontrivial band topology is characterized by a generalized spin Chern number Cs+ = 2 when there is a gap between two sets of ŝx eigenvalues. Using the tight-binding model, the calculated spin Hall conductivity is quantized to σ x yz = ( e ) Gxe 2 πh with Gx a reciprocal lattice vector.