Interesting question !

Let us denote $L_X:\beta\mapsto X^T\beta X$. This is an endomorphism of ${\bf Sym}_n({\mathbb C})$.

**Lemma**. The characteristic polynomial of $L_X$ is
$$\prod_{i\le j}(t-\mu_i\mu_j)$$
where $\mu_1\ldots,\mu_n$ are the eigenvalues of $X$.

*Sketch of the proof* : the characteristic polynomial has degree $n(n+1)/2$. Suppose that $X$ is diagonalisable, and that the products $\mu_i\mu_j$ are pairwise distinct. Then each $\mu_i\mu_j$ is an eigenvalue, associated with an eigenvector $\ell^T_i\ell_j+\ell^T_j\ell_i$ where $\ell_iX=\mu_i\ell_i$. So these are all the eigenvalues and the formula is correct in this case. Because the characteristic polynomial of $L_X$ is also a polynomial in the entries of $X$, as well as the product indicated above, the equality stands in the closure (topological or Zariski) of the special case, which is ${\bf M}_n(\mathbb C)$.

Now, what are we looking for ? An eigenvector $\beta$, non-singular and associated with the eigenvalue $1$. Thus we need $\mu_i\mu_j=1$ for some pair. But not only for *some*, because $\ell^T_i\ell_j+\ell^T_j\ell_i$ is singular (unless $n=2$). What we really need is enough multiplicity that we can pick a non-singular eigen-matrix. If $X$ is diagonalizable, this means that the eigenvalues be associated pairwise:
$$\mu_1\mu_n=\mu_2\mu_{n-2}=\cdots=1.$$
Notice that if $n$ is even, this yields the necessary condition that $\det X=1$. It was obvious *a priori* that $(\det X)^2=1$, but actually the case $-1$ is excluded. This ressembles the well-known fact that symplectic matrices have determinant $+1$.

**Edit**. A more direct and definitive way to arrive to this conclusion : if $\beta$ exists, then $X^{-T}=\beta X\beta^{-1}$, that is $X^T$ is conjugated to $X^{-1}$. This proves that $\lambda\mapsto\lambda^{-1}$ is an involution of the spectrum of $X$. Conversely, suppose that $X^t$ and $X^{-1}$ are conjugated ; can we choose a symmetric conjugation matrix ? The answer is **no**, as shown by the counterexample
$$X=\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}.$$