Others have provided intuitive explanations; I thought I’d provide a short mathematical one.

Suppose a firm faces a production function $q = f(K,L)$. Assume $f_K, f_L > 0$ and $f_{KK}, f_{LL} < 0$. (The former is entailed by the assumption that firms wouldn't invest in capital or labor if it wasn't increasing their gains, while the latter is the law of diminishing marginal product.) 

Let the cost of capital (per unit) be $r$ and the cost of labor (per unit) be $w$. 

The firm’s problem is:

$$\max_{K,L} π = pf(K,L) - rK - wL$$

Now, a profit-maximizing firm’s first order conditions are:

$$π_K = pf_K - r = 0 \\ π_L = pf_L - w = 0$$

We can rearrange terms to represent these conditions as:

$$p = \frac{r}{f_K} \\ p = \frac{w}{f_L}$$

Equating the two:

$$\frac{r}{f_K} = \frac{w}{f_L} \implies \frac{f_L}{f_K} = \frac{w}{r} $$

Since $MP_L \equiv f_L$ and $MP_K \equiv f_K$, we get:

$$\frac{MP_L}{MP_K} = \frac{w}{r}$$

Hope that helps.