We consider the indefinite Sturm–Liouville differential expression \(\begin{aligned} {\mathfrak {a}}(f):= - \frac{1}{w}\left( \frac{1}{r} f' \right) ', \end{aligned}\) where \({\mathfrak {a}}\) is defined on a finite or infinite open interval I with \(0\in I\) and the coefficients r and w are locally summable and such that r(x) and \(({\text {sgn}}\,x) w(x)\) are positive a.e. on I. With the differential expression \({\mathfrak {a}}\) we associate a nonnegative self-adjoint operator A in the Krein space \(L^2_w(I)\) which is viewed as a coupling of symmetric operators in Hilbert spaces related to the intersections of I with the positive and the negative semi-axis. For the operator A we derive conditions in terms of the coefficients w and r for the existence of a Riesz basis consisting of generalized eigenfunctions of A and for the similarity of A to a self-adjoint operator in a Hilbert space \(L^2_{|w|}(I)\) . These results are obtained as consequences of abstract results about the regularity of critical points of nonnegative self-adjoint operators in Krein spaces which are couplings of two symmetric operators acting in Hilbert spaces.