Why WhatsApp compresses at all
WhatsApp carries an enormous volume of images across networks of wildly varying quality, much of it on prepaid mobile data. Compressing aggressively keeps messages delivering quickly on a poor connection and keeps costs down for everyone in the chain.
That is a reasonable trade for a chat app, and it is not something you can switch off. What you can do is choose a path that does not go through the photo pipeline at all.