We present the manifestly covariant canonical operator formalism of a Weyl invariant
(or equivalently, a locally scale invariant) gravity whose classical action consists of the well-known conformal
gravity and Weyl invariant scalar-tensor gravity, on the basis of the Becchi-Rouet-Stora-Tyupin (BRST) formalism.
Based on this formalism, we analyze the physical states by expanding the metric around a flat Minkowski background
and the scalar field around a constant background. It is shown that under the assumption of no bound states
the physical modes are composed of both a massive tensor ghost of five components with indefinite norm and a massless
graviton of two components with positive semi-definite norm. The unitarity of the physical S-matrix is violated by the presence
of the massive ghost. On the other hand, if the Weyl BRST transformation of the massive ghost has a bound state, the massive ghost
is confined in the zero-norm states by the BRST-quartet mechanism so the physical S-matrix becomes unitary.
This mechanism of the ghost confinement might pave the way for a long-standing problem of the unitarity violation
in quadratic gravity or higher-derivative gravity.