The truth is no one is certain why. However, there seems to be no pattern in our solar system. Even the sun has a slight tilt at about 7°. The only planet with a near zero tilt is Mercury. Compare that to Uranus which almost spins sideways at 97°. As mentioned in the comments, collisions make a good case for all this randomness of angles, however, there has been no real way to observe this type of event as proof.
On the Internet you can find a variety of ideas from bizarre EM perturbations to the idea they are primordial and/or collision related. There are some models/ideas that show this angle can be very chaotic and the moon plays a strong role in stabilizing the Earth. (Laskar, J.; Joutel, F.; Robutel, P. (1993). "Stabilization of the Earth's Obliquity by the Moon")
Based on Berger, A.L. (1976). "Obliquity and Precession for the Last 5000000 Years": For the past 5 million years, Earth's obliquity has only varied between 22° 02' 33" and 24° 30' 16". So whatever the cause it seems the Earth's angle is quite stable.
Without our 23° we wouldn't have seasons or longer nights and shorter days throughout the years. The angle of obliquity also is a major driving factor for weather triggering massive releases of energy during times of tropical revolving storms (hurricanes) which effect the planet's heating and cooling cycle world wide. The world that we have adapted to would be a very different place without our tilt. In general less tilt would mean colder poles and hotter equator and more tilt would have more extreme seasons of hot and cold. In either case the shift in growing seasons and belts would probably cause massive shift in food production, most likely in a bad way ... assuming the plants could survive the change too.