Could you help me understand how the checking of the transaction fee is an effective precaution?
There are 2 common reasons that a transaction might not confirm, and a double spender will have an opportunity to replace the transaction with a different one that pays himself instead of the merchant.
1. If a transaction does not include a sufficient transaction fee, then miners will not have enough incentive to include it in the blocks they are working on. After a few days, the network will forget about the transaction. The attacker will then have an opportunity to broadcast a replacement transaction that pays himself instead of the merchant.
2. If a transaction is not well propagated, then many nodes and miners will not have seen the transaction yet. This allows the attacker to immediately broadcast a replacement transaction to those nodes and miners and have a high probability that the replacement transaction will be confirmed instead of hte original one. Since nodes will refuse to relay transactions with small outputs, unless they include a sufficient fee, the attacker can reduce propagation by reducing the fee.
If a miner includes a sufficient fee, then the transaction will be relayed by any node that sees the transaction, and there will be enough incentive to the miners for the transaction to become confirmed long before the network forgets about it.
A merchant can further reduce their risk by maintaining direct connections to the largest mining pools and any pools or miners known to accept low priority free transactions, and rebroadcasting every 2 or 3 days any transactions that they have received that haven't been confirmed yet. This will refresh the transaction in the memory of the pools so they won't forget about the transaction, and will therefore prevent any replacement transaction from propagating to the pools and miners.
If I understood correctly how the whole thing works, if someone want to perform a double spending with 10 BTC then including 0.001 BTC transaction fee is very minor cost comparing to the possible gain from the malicious double spending, so I guess the double spender would be happy to include the small transaction fees in many transactions.
That fee is far larger than necessary in most cases. The merchant would want to check the size of the transaction (in bytes, not in bitcoins), and then verify that a fee of at least 0.0001 BTC per kilobyte was paid. Since most transactions are less than a kilobyte in size, this means that in most cases the fee would only need to be 0.0001 BTC.