I’d say it’s a variety of factors, all already covered here.
First off, packaging. Designing a car is complicated and the bigger the tank the more effort you have to put into finding a place to put it while avoiding drivetrain components without encroaching on the interior or cargo space of the vehicle.
Next, safety… it’s easier to protect a smaller fuel tank from a crash.
Next, cost… parts cost money. Smaller tank is cheaper.
Finally, fuel economy. I don’t know how the fuel economy tests are done but if we assume they are done at a fixed percentage of fuel in the tank the smaller tank will mean a lighter vehicle which will mean better MPG results.