Here's a quick proof:
Suppose for the purpose of contradiction that $\det(M) = -1$. We can conclude that the eigenspace of $M$ associated with the eigenvalue $-1$, $U = \ker(M + I)$, has an odd dimension. Because $PM = MP$, we can conclude that $U$ is an invariant subspace of $P$. Indeed, for $x \in U$, we have
$$
M(Px) = PMx = -Px,
$$
which is to say that $Px$ is an eigenvector of $M$ associated with $-1$, which means that $Px \in U$.
Now, the restriction $P|_U : U \to U$ is a linear map over a space with odd dimension. It follows that $P|_U$ has an eigenvalue (i.e. a real eigenvalue), which in turn implies that $P$ has an eigenvalue, contradicting our premise.
Regarding the characterization of $S = \{P \in SO(2k) : MP = PM\}$: begin by supposing that $M$ is in the canonical form
$$
M = \operatorname{diag}(a_1 I_{2n_1} + b_1 J_{2n_1}, \dots,a_m I_{2n_m} + b_m J_{2n_m},I_p, -I_q),
$$
where each pair $a_i,b_i \in \Bbb R$ satisfies $a_i^2 + b_i ^2 = 1$ and $b_i \neq 0$, we have $(a_i,b_i) \neq (a_j,b_j)$ whenever $i \neq j$, $I_n$ denotes the identity matrix of size $n$, and
$$
J_{2n} = \pmatrix{0 & -I_n\\I_n & 0}.
$$
A matrix $P \in \Bbb R^{(2k)\times(2k)}$ will satisfy $MP = PM$ if and only if it has the conformal block diagonal form
$$
P = \operatorname{diag}(I_2 \otimes A_1 + J_2 \otimes B_1, \dots,
I_2 \otimes A_m + J_2 \otimes B_m,C,D),
$$
where $\otimes$ denotes the Kronecker product, $A_i,B_i$ are square of size $n_i$, and $C,D$ are square of sizes $p$ and $q$ respectively. $P$ is an element of $SO(2k)$ if and only if each of its blocks on the diagonal is orthogonal and the product of their determinants is $-1$.
For an arbitrary $M\in O(2k)$, there exists a matrix $V \in O(2k)$ such that $VMV^T$ is in the above canonical form. From there, it suffices to note that $PM = MP$ if and only if $(VPV^T)(VMV^T) = (VMV^T)(VPV^T)$.
Notably, every matrix of the form $K = I_2 \otimes A + J_2 \otimes B$ (for $A,B \in \Bbb R^{n \times n}$) has positive determinant. $K$ will be orthogonal (and therefore, due to the sign of its determinant, an element of $SO(n)$) if and only if the complex matrix $\tilde K = A + iB$ is unitary, which is to say that it satisfies $\tilde K^*\tilde K = I_n$ where $A^*$ denotes the conjugate-transpose of $A$.
With that, we can conclude that $S$ is isometric to
$$
U(n_1) \oplus \cdots \oplus U(n_m) \oplus
[(SO(p) \oplus SO(q)) \cup (O^{-}(p) \oplus O^{-}(q))],
$$
where $O^-(n) = O(n) \setminus SO(n)$.