In order to compensate for the $r$ in the volume element $r\ dr\ d\phi\ dz$ you need a factor $\frac{1}{r}$ in your charge density $\rho$. And the over-all constant is adjusted so that the total volume integral will be $Q$. You finally get $$\rho(r,\phi,z)=\frac{Q}{2\pi rL}\delta(r)\theta(L/2-|z|)$$
The term $\frac{1}{2\pi r}\delta(r)$ might seem weird from a mathematical point of view at first, but it is actually equal to $\delta(x)\delta(y)$. See also the math question Dirac delta in polar coordinates and its accepted answer.