We consider the Koopman operator generated by an invertible transformation of a space with a finite countably additive measure. If the square of this transformation is ergodic, then the orthogonal Koopman operator is a symplectic transformation on the real Hilbert space of square summable functions with zero mean. An infinite set of quadratic invariants of the Koopman operator is specified, which are pairwise in involution with respect to the corresponding symplectic structure. For transformations with a discrete spectrum and a Lebesgue spectrum, these quadratic invariants are functionally independent and form a complete involutive set, which suggests that the Koopman transform is completely integrable.