Because the earth's axis is tilted. It is all about the tilt of the Earth's axis.
During the summer, the sun's rays hit the Earth at a steep angle. The light does not spread out as much, thus increasing the amount of energy hitting any given spot. Also, the long daylight hours allow the Earth plenty of time to reach warm temperatures.
During the winter, the sun's rays hit the Earth at a shallow angle. These rays are more spread out, which minimizes the amount of energy that hits any given spot. Also, the long nights and short days prevent the Earth from warming up. That's why we have winter.