Aside from the bad design, why do you say this doesn't divide by 2? A frequency counter will show 1/2 the frequency.
To fix bunalmis' circuit, add an inverter between In and the And gate - then there won't be any glitches.
Gee laglead did you even read the replies before posting yours?
There are several replies that use a delay with logic and they have details on the solution.