I saw this image of a Cessna 172's tail posted on another question and it made me wonder why the beacon light is basically a cylinder, and not a more aerodynamic, teardrop shape?
That beacon lens (and most of the strobe lenses shaped like it) are actually Fresnel lenses.
They are optically designed to produce a specific plane & intensity of coverage, and tinted for a specific color. (The color, intensity, and plane are specified in the FARs & applicable Technical Standard Orders if you want to go hunt down the requirements.)
The lens optics are easier to see on the split (Red/White) lenses:
A Fresnel lens is not the only way to meet these requirements, some anti-collision lights do it by sheer intensity (while retaining the "jar" shape, mainly for installation compatibility), and as GdD pointed out there are more aerodynamic options available. The Fresnel lens method is usually adequate for smaller/slower aircraft however, and the drag penalty at relatively low speeds isn't significant enough for designers to worry about.
Your assumption that all are round is faulty, plenty are teardrop shaped.
You'll see round ones on many slower aircraft where streamlining isn't as big an issue, however on faster aircraft they are almost always aerodynamic.
Taking a look to the photograph you are showing not only the lights are not very aerodynamic, you can see as well that the fairing on the tail could have a softer transition, the rivets used are not the ones used in commercial het airplanes and transition between plates is also not smooth. You can see that the aerodynamics is open to improvements.
The answer is overall airplane optimization.
Cessna 172 is an small airplane of 3 passenguers and one pilot. Customers of this airplane will be mainly of 2 kinds:
Notice that although the airplane has an autonomy of 1200km, usually is not able to compete in routes of that distance as airplanes like A320 will be able to offer a cheaper ticket. Is a typical airplane for travels between islands with low traffic.
In that context...
In the overall context of the lifetime of the airplane the fuel consumption (driven by the aerodynamic drag) will be smaller than the effect of the amortization of the airplane (capital costs) and maintenance.
In order ot reduce aerodynamic drag and fuel comsuption in general (weight reduction), that will imply extra costs on each manufactured airplane:
Basically the manufacturer (Cessna) needs to make a decision between:
In that trade-off, for this specific model and my understanding of the customer objective, is more attractive to create a cheaper airplane.