How are the "real" spherical harmonics derived? How were the real spherical harmonics derived?
The complex spherical harmonics:
$$
Y_l^m( \theta, \phi ) = K_l^m P_l^m( \cos{ \theta } ) e^{im\phi}
$$
But the "real" spherical harmonics are given on this wiki page as
$$
Y_{lm} =
\begin{cases}
\frac{1}{\sqrt{2}} ( Y_l^m + (-1)^mY_l^{-m} ) & \text{if } m > 0 \\
Y_l^m        & \text{if } m = 0 \\
\frac{1}{i \sqrt{2}}( Y_l^{-m} - (-1)^mY_l^m)       & \text{if } m < 0
\end{cases}
$$


*

*Note: $Y_{lm} $ is the real spherical harmonic function and $Y_l^m$ is the complex-valued version (defined above)


What's going on here?  Why are the real spherical harmonics defined this way and not simply as $ \Re{( Y_l^m )} $ ?

The page actually suggests the answer when it says "The harmonics with $m > 0$ are said to be of cosine type, and those with $m < 0$ of sine type." Recall how one switches between the complex exponential functions $\{e^{imx}\colon m\in \mathbb Z\}$ and the trigonometric functions: it's done with the formulas $$\cos mx=\frac{e^{imx}+e^{-imx}}{2}$$ and $$\sin mx=\frac{e^{imx}-e^{-imx}}{2i}$$
Taking only real parts would not give you the sines.
Since $\cos (-mx)=\cos mx$ and $\sin(-mx)=-\sin mx$, we don't need all values of $m$ in both families. We can remove the redundant functions and enumerate the entire trigonometric basis by $m\in\mathbb Z$ as follows: 
 $\{\cos mx\colon m\ge 0\}\cup \{\sin mx\colon m<0\}$. This is essentially what the wiki page does.
