In general, the lagrangian of a simple pendulum of longitude $l$ that moves in radial and angular directions is:
$$\mathcal{L}(r, \theta) = \frac{1}{2}m(\dot{r}^2 + r\dot{\theta}^2) - mgr(1-\cos(\theta)),$$
where, for your case $r = l - \alpha t$, leading to the following lagrangian:
$$\mathcal{L}(\theta, t) = \frac{1}{2}m(\alpha^2 + (l-\alpha t)\dot{\theta}^2) - mg(l - \alpha t)(1-\cos(\theta)).$$
As we can see, the radial coordinate is not a dynamical variable since we have explicit its time dependence. In fact, what you have done is a reparametrization of the Lagrangian: $\mathcal{L(r(t), \theta(t))} \to \mathcal{L(t, \theta(t))}$. This reparametrizacion implies, for example, that the energy is not conserved anymore and also, that the Hamiltonian do not corresponds with the energy of the system.
Now, the only dynamical variable is the angle $\theta$, because $l$ and $\alpha$ are constants. Computing the Hamiltonian we will have
$$\mathcal{H}(\theta, t) = p_{\theta}\dot{\theta} - L(\theta, t).$$
In general, I recommend you to write down your lagrangians in the most general form depending in the best-suited coordinates for your system (i.e. polar, cylindrical, spherical…), each coordinate is a dynamical variable, a priori. Then apply the constraints to the lagrangian and check what are the remaining coordinates on it, each of them will have associated a momentum when calculating the Hamiltonian.