A lot of people consider an emergency more important to have readily available, and thus more important than the match.
But you're right to a certain extent. I would prioritize a smaller emergency fund, or even just a Financier buffer, before the match, and then 401k match, and then the rest of the emergency fund.
Totally depends on the situation though. It is free money.
