Yet another solution:
The top of the ladder is at $(x+\cos \theta,kx+\sin \theta)$, where $\theta$ is the anti-clockwise angle from the $x$ axis. The problem is then $\max_{\theta, x} \{ kx + \sin \theta | x + \cos \theta = 0 \}$. The constraint bounds $|x|$ by $1$, and the problem is equivalent to $\max_{\theta, x} \{ kx + \sin \theta | x + \cos \theta = 0,\ \theta \in [0,2 \pi] \}$, hence the feasible set may be taken to be compact and non-empty, hence a solution exists.
Then we use Lagrange to characterize the solutions:
$$ \binom{k}{\cos \theta} + \lambda \binom{1}{-\sin \theta} = 0$$
which reduces to $\cos \theta = - k \sin \theta$. Squaring and using the identity $\cos^2 x + \sin^2 x = 1$ gives $\sin \theta = \pm \frac{1}{\sqrt{1+ k^2}}$, and the Lagrange condition then gives $\cos \theta = \mp \frac{k}{\sqrt{1+ k^2}}$, and hence the constraint gives $x = \pm \frac{k}{\sqrt{1+ k^2}}$. Choosing the higher objective value, we have the solution $x = \frac{k}{\sqrt{1+ k^2}}$, with optimal value $\sqrt{k^2+1}$.
To confirm your intuition: If we let $\alpha$ satisfy $\cos \alpha = \frac{1}{\sqrt{1+ k^2}}$, $\sin \alpha = \frac{k}{\sqrt{1+ k^2}}$, then we see that if $\theta$ is the optimal angle, then $\theta = \alpha + \frac{\pi}{2}$ (modulo $2 \pi$, of course).