Why labour, capital, and output levels cannot be pinned down in perfect competition? Consider a firm producing with the following technology:

\begin{equation}
 Y = AL^{\alpha}K^{\beta}
\end{equation}

Assuming that factors are paid their marginal contribution to output, it can be shown that the optimal factor choice for this firm is:

\begin{equation}\label{eq:k-l ratio}
 \frac{L^*}{K^*} = \frac{\alpha}{\beta}\frac{r}{w}
\end{equation}

(this comes from finding each factor's payment, and combining them)

Thus, the furthest we can go in terms of characterising the equilibrium in this economy/firm relates to the optimal capital-labour ratio. In effect, nothing can be said about the level of inputs and outputs, $L^*$, $K^*$, or $Y^*$.

This is not the case if there is just one input. For instance, if $Y=AL^\alpha$, then 

$$L^*=\left(\alpha A\frac{p}{w}\right)^{1-\alpha}$$

The reason is not related to the degree of returns to scale, as this is not constrained. It is not related to elasticity of substitution either, as in the case of a CES, it is also the capital-labour ratio which is solved for. Here, the solution is 

$$ \frac{L^*}{K^*} = \left(\frac{\alpha}{1-\alpha}\frac{r}{w}\right)^\sigma $$

So, the question is, why can we not pin down the level of optimal inputs and output? Is this because we have treated factor prices as exogenous, so we are missing the supply side of each factor market?
Thus, the furthest we can go in terms of characterising the equilibrium in this economy/firm relates to the optimal capital-labour ratio. In effect, nothing can be said about the level of inputs and outputs, $L^*$, $K^*$, or $Y^*$.


I don't think this is true. You combined two equations into one, and thereby lost information. The optimization problem is

\begin{equation}
 \max_{K,L} p\cdot AL^{\alpha}K^{\beta} - w \cdot L - r \cdot K
\end{equation}
Taking derivatives w.r.t. $L$ and $K$ yields two first order conditions and the only two unknowns are $L$ and $K$.
$$
\alpha \cdot p\cdot AL^{\alpha-1}K^{\beta} = w
$$
$$
\beta \cdot p\cdot AL^{\alpha}K^{\beta-1} = r.
$$
As you noted this implies the cost minimization equation of
$$
\frac{L^*}{K^*} = \frac{\alpha}{\beta}\frac{r}{w},
$$
but why go that way? You could get
$$
L = \left(\frac{r}{\beta \cdot p\cdot A K^{\beta-1}}\right)^{\frac{1}{\alpha}}
$$
and plug this into the first equation, yielding
$$
\alpha \cdot p\cdot A\left(\frac{r}{\beta \cdot p\cdot A K^{\beta-1}}\right)^{\frac{\alpha-1}{\alpha}}K^{\beta} = w.
$$
And then
$$
K^{\frac{\alpha\beta - (\alpha-1)(\beta-1)}{\alpha}} =
K^{\frac{\alpha + \beta - 1}{\alpha}}
= \frac{w}{\alpha \cdot p\cdot A\left(\frac{r}{\beta \cdot p\cdot A}\right)^{\frac{\alpha-1}{\alpha}}}.
$$
Clearly this is not very pretty but it is very solvable.

Note: I did not go into second order conditions but this is only a maximum if $\alpha + \beta &lt; 1$.