Pilot here (with Cessna 152 hours) as well as an engineer who made it most of the way to an Airframe and Powerplant technician license at one point in life.
There are several reasons that conspire to produce 'unusable fuel':
Fuel tanks on airplanes have complex shapes - they include baffles and other walls (with holes in them) to prevent oscillations from building up during in-flight movement.
Sometimes these baffles are even engineered into the tanks late in the design cycle as testing finds oscillation issues.
These baffles result in 'geometric trapping' of fuel in nooks and crannies.
Drawing fuel from a fuel tank is more complicated in a plane - cars
are pretty much flat with minor tilts while airframes can have all sorts of odd and sustained directions that the fuel wants to go due to acceleration.
Imagine an extended tilted spiral while descending - that fuel experiences far more lateral acceleration over a longer time period that a car would have.
Getting the fuel system to pull fuel out from these different angles is challenging (note that I've picked a non-aerobatic maneuver for which the Cessna 152 of your question is qualified here).
All of this is a cost/complexity tradeoff - solutions exist for 1 and 2 above - fighter jets use fuel bladders that have pressure bladders arranged to squeeze the fuel out so that they can get almost all the fuel even at high G-forces and unusual angles.
Aerobatic planes have similarly more expensive and complicated systems than the old and cheap Cessna 152.
There are other considerations as well, but mostly it comes down to whether the plane in question can justify the cost and effort to get every last drop of fuel.
Things get even more complicated in rockets - the moon rockets (properly the Saturn 5 although it was an upper stage specifically) had special extra engines called ullage motors whose only job was to give the stage a little boost in space to push the fuel towards the rear of the rocket so that the main motors could draw fuel and start.
Addendum edit: @supercat below -
the definition of unusable fuel is set by federal aviation regulation part 23, section 959 ( FAR 23.959 ) and basically is the worst case under "intended operation" for the particular plane.
Since the Cessna 152 is not aerobatically rated, for example, the unused fuel is defined as the fuel level where SOME intended maneuver would be capable of causing a fuel system error.
In practice, especially in flat level flight, some of that unusable fuel would be available for use although you are not supposed to plan to use it in your flight planning.
aviation.stackexchange.com/users/7688/Ezekiel Kruglick
especially since water contamination of fuel is a concern?
That's one of the reasons.
Fuel floats on water, so water collects in the bottom of the tank, along with other gunk.
By not taking the last dregs of fuel from the bottom of the tank you avoid putting this stuff into the engine
aviation.stackexchange.com/users/1576/NobodySpecial
Almost any system that moves liquid around will retain a certain volume.
In your case, there are various bends in the pipes and some of those bends go up.
Yes, it's gravity-fed but notice the shutoff valve on the floor.
Now notice the level of the carburetor.
Any fuel below the level of the carb bowl is unusable, as we have no way to push it through the rest of the plumbing without more liquid behind it.
If we turn to things with a pump the unusable quantity can go up, a lot.
The volume of liquid between the pump and the final destination would be considered unusable for the same reason - once the pump is dry we can't move it along anymore.
One restaurant manager I used to know installed a metered drink dispensing system.
All the booze is in the (locked) storage room, the bartenders push a button and exactly one ounce comes out of the tap.
The only complaint he had was that the system cost $500 to prime, per item , and he had to keep thousands of dollars of "unusable" alcohol on the books.
aviation.stackexchange.com/users/1632/paul
The term "unusable" is a very special definition.
It comes from a specific test described in FAA FAR Part 23.
It is not the same as the common sense meaning of the word "unusable".
For single engine light planes like Cessna 152, FAA FAR Part 23 requires the available fuel flow to be 125% of max engine consumption.
150% for pure gravity feed systems.
At certification test the fuel flow is measured while the level is dropping in the tanks.
As soon as the flow rate goes below 125 or 150 % all remaining fuel is declared unusable.
This shall be done with the plane supported in climb nose up atitude.
So, the formal term "unusable" means this last amount of fuel might be unavailble in a nose up attitude at full engine power.
In level cruise you can normally empty the fuel tanks to the last drop.
aviation.stackexchange.com/users/7892/Wirewrap
I pitch in blind here, but I believe in some instances fuel is circulated for heat exchange.
aviation.stackexchange.com/users/7708/PCARR
I learned from  this question  that a Cessna 152 holds 5.6 litres of fuel that it can't use.   Why would it be designed to hold fuel that it cannot burn, especially since water contamination of fuel is a concern?
Why do aircraft have an unusable amount of fuel?
aviation.stackexchange.com
<aircraft-design><fuel-tanks>
aviation.stackexchange.com/questions/13326
aviation.stackexchange.com/users/5517/FreeMan
It seems planes may hold more fuel than they can use because some fuel is circulated for heat exchange. Fuel is sometimes circulated for heat exchange.
Fuel is sometimes circulated for heat exchange.