For simplicity work with two particles. If they were distinguishable, every physical state could be described as
$|\Psi \rangle = \sum_{ij}c_{ij} |\psi_i\rangle \otimes |\phi_j\rangle \in H_1\otimes H_2$
with $|\psi_i\rangle, |\phi_j \rangle $ in $H_1, H_2$ one-particle basis state vectors respectively. Now the exchange operator $\hat{P}$ is defined by acting on direct product states as
$\hat{P}( |\psi\rangle \otimes |\phi \rangle) = |\phi\rangle \otimes |\psi \rangle $
Now consider again general states $|\Psi\rangle \in H_1 \otimes H_1$ where now the particles are identical and indistinguishable. This implies that of all the states in $H_1^{\otimes 2}$ the only physical ones are those, that gain only an overall phase factor by $\hat{P}$, i.e.
$\hat{P}|\Psi\rangle=\sum_{ij}c_{ij}|\phi_j\rangle \otimes |\psi_i\rangle = e^{i\theta} |\Psi\rangle \Leftrightarrow |\Psi\rangle \text{is physical} $
since $|\Psi\rangle$ and $e^{i\theta}|\Psi\rangle$ correspond to the same physical state. Thus the physical states are those that are eigenstates of $\hat{P}$. Since $\hat{P}^2 = \mathbb{1}$ for eigenstates $|\Psi\rangle$
$|\Psi\rangle = \hat{P}^2 |\Psi\rangle = \hat{P} e^{i\theta} |\Psi\rangle = (e^{i\theta})^2 |\Psi\rangle $
the eigenvalues of $\hat{P}$ are $\pm 1$. Thus although the physicality condition for $|\Psi\rangle$ only requires for the wave functions to be related by a phase, the fact that the states and thus wave functions need to be eigenvectors of the exchange operator forces the eigenvalues to be $\pm 1$. So for wave functions
$\Psi(x_1,x_2) = \langle x_1,x_2 |\Psi \rangle = \langle x_2,x_1| \hat{P} |\Psi\rangle =(\pm1) \langle x_2,x_1|\Psi \rangle = (\pm1)\Psi(x_2,x_1)$
where in the second step $\hat{P} = \hat{P}^\dagger$ was assumed.