Constraints on the polar angle (θ) in the particle in a sphere problem
First of all, as orthocresol and porphyrin said, we should keep in mind that $\phi$ and $\theta$ must span different sets, and there are different conventions on them:

Any spherical coordinate triplet (r, θ, φ) specifies a single point of three-dimensional space. On the other hand, every point has infinitely many equivalent spherical coordinates.
[...]
If it is necessary to define a unique set of spherical coordinates for each point, one must restrict their ranges. A common choice is:
$r$ ≥ 0
0° ≤ $\theta$ ≤ 180° ($\pi$ rad)
0° ≤ $\phi$ &lt; 360° ($2 \pi$ rad)

(Source)
In other words (using the convention above), you must have both $\psi(r, \theta, \phi) = \psi(r, \theta, \phi + 2 \pi)$ and $\psi(r, \theta, \phi) = \psi(r, \theta + 2 \pi, \phi)$ for spherical periodicity.
This is the basic symmetry on a sphere.
But the assignment $(r, \theta, \phi) \rightarrow (x, y, z)$ becomes &quot;ambiguous&quot; (not injective) if the function is defined as an application from $[0, \infty) \times [0, 2 \pi] \times [0, 2 \pi)$ to $\mathbb{R}^3$ and hence not invertible.
You can easily see this if you imagine mapping the surface of earth by having a very long rope with its ends fixed at both poles (half diameter, 180°) and an airplane carrying the middle of this rope around the globe (full diameter, 360° movement).
That being said, the mapping $(r, \theta, \phi) \rightarrow (x, y, z)$ must be taken from $[0, \infty) \times [0, \pi] \times [0, 2 \pi)$ to $\mathbb{R}^3$.
But that does not mean that $\psi(r, \theta, \phi) = \psi(r, \theta + \pi, \phi)$, and as higgsss observed, $\psi(r, \theta + \pi, \phi)$ is not necessarily equal to $\psi(r, \theta, \phi)$.
But higgsss also observed that, for some problems, some solutions might have symmetries allowing $\psi(r, \theta, \phi) = \pm \psi(r, \theta + \pi, \phi)$.
Solutions for the hydrogen atom are good examples of this: for the minus sign, p atomic orbitals, and, for the plus sign, d atomic orbitals.
You can see other orbital symmetries by looking at them here.