Sure, a bow is potentially better--with longer range and possibly two attack rolls per round--but not everyone can use a bow, and it's a minimum 35gp (short bow) or 50gp (longbow) investment.
Moreover, oil can be used to fuel lanterns, deter monsters, temporarily obstruct routes, and make slippery patches.
At 2 gp per flask, no low level adventurer can afford to be without a least a couple of flasks
