Why were tenements constructed as tall, narrow buildings?

Why were tenements constructed as tall, narrow buildings?