Housing problems: rent controls

If rent controls are so counterproductive, why do cities impose them? How else might the housing problems of poor people be solved?