Glass is competitively heavy and thick so adds to transport requirements. It also can't [generally] be made on site, unlike cans which are generally formed in the food factory for larger scale producers.
There is also breakages to consider. Modern 'bottling' plants move at an incredible speed and where glass is fragile any chips or breakages can shut the line down for cleaning; shards of glass are nasty to get in your drink. There is also transport, rough handling is much more likely to break glass bottles than burst cans, the cleanup is also easier with cans, and as glass weighs more it also adds to handling costs. This also applies to recycling, a bottle takes up much more space in your recycling bin than a bottle does.
Personally I too prefer glass, but once you get beyond extremely local small scale production the considerations change dramatically.
Soda tastes better, anything tastes better in a glass container.
Even aluminum canned soda has an aluminum taste, plastic bottles have an after taste.
Maybe we need to ditch plastic and aluminum packaging for bottles like we used to.
I still buy plenty of drinks in plastic but if I have an option for the same price I'll get it in glass, for instance grape jelly. It's roughly the same cost for plastic or glass.