This is because nature is not often as perfect as we tend to imagine it to be :)
In reality, when close to the Sun, the Earth has a little "too much speed" for it to stay that deep in the Sun's gravity well. In other words, the local spacetime curvature induced by the Sun is not strong enough to keep the Earth as close to it as it is, given that it also moves sideways; the Earth will start to "climb out" of the gravity well.
Building on your intuitions from everyday life, you know that if you move fast at the bottom of a hill, you'll be able to go up the hill, at the expense of your speed. You'll go higher and higher, but also slower and slower. The same holds in the context of the Earth. The further out of the gravity well it climbs, the slower it will move. At a certain point it will have climbed so far out that it actually moves too slow to stay as far out of the well as it is; it will start falling back in.
If you consider also the Earth's sideways motion and assume the Earth's motion is exactly perpendicular to the line of sight between the Earth and the Sun at the point where it moves slowest, it is not hard to imagine that the point where the Earth has its lowest speed is on the exact opposite side of the Sun as where it will have its highest speed. From that, it is not hard to imagine that the net result of all this will be an elliptic orbit, rather than a perfectly circular one.
Now, this does not mean it is not possible to have circular orbits. Of course, if the Earth would have had the exact amount of energy required to stay on the exact same distance from the Sun at all times, the orbit would have been circular. But this is nice in theory, but practically impossible to realize given that even the slightest perturbation from Jupiter or asymmetry in the Sun or whatever would cause the Earth's orbit to start deviating from a circle. Practically speaking, a circular orbit is a limit case that you can get arbitrarily close to, but never quite reach.
I think this video will help. Look at the motion of the balls in the cone; virtually the same principles apply for this case.
For completeness: there are many details I have omitted here that influence the exact shape of the orbit -- the "hill" analogy (or bowling-ball-on-a-rubber-sheet analogy, as it is often depicted in movies or documentaries) is an inaccurate and incomplete representation of the true nature of spacetime. Also, the other planets, remote galaxies, in-homogeneity of the Sun's gravity field, etc. distort the Earth's local spacetime. But all these effects are relatively small, and can safely be ignored to understand the ellipticity of the orbit.