Exchanges charge withdrawal fees as a means to make money, and to offset the actual amount of expenses they incur in processing a withdrawal. Exchanges charge a fixed fee to process withdrawals because they have dominant pricing power.
It could also be because said exchanges haven't designed an internal mechanism to adjust the fee of a user's transaction in the first place and just assigned a static constant for everybody regardless of network conditions.
That is possible. I think some exchange executives might argue that having a fixed withdrawal fee provides for an improved customer experience, even if this means customers pay a higher fee -- for example, a customer will know how much it will cost him to withdraw prior to depositing.
I would also point out that automating anything involving servers that contain your hot wallet is risky. There is the potential your server will be tricked into paying enormously high fees. It also means your server will have to
receive information directly from the internet. I imagine that major exchanges use servers that only connect to other servers on their local intranet that is used to create/sign withdrawal transactions. Obviously, eventually, the server will be connected to a server that is directly connected to the internet but compromising a chain of servers whose interactions are limited is more difficult than compromising a server directly connected to the internet. This is obviously not the same as having a cold wallet, but is also more secure than having your private keys in an unencrypted state in RAM on a computer directly connected to the internet.