You don't have to "desire" baptism to qualify.
If I recall my school theology, and the subsequent logic correctly, originally the Catholic church held that only people who had been baptised could have a chance of going to heaven. That was fine until they started thinking about the people who had never heard of the Christian faith, but lived a good and moral life according to their own beliefs.
Excluding them from heaven seemed like a bad idea, so the idea of baptism of desire was introduced. By living a good and moral life they showed a desire to be at one with God despite not knowing about him. This indicated that if they had known about the Christian God, they would have converted and been baptised. This meant that they desired baptism even though they didn't know about it, and so were considered to have been baptised when they died.
Of course back then there weren't as many atheists around as there are now, but the same original problem applies - most atheists live a good and moral life, so excluding them from an eternal life they don't believe in seems a bit daft (yes I know it sounds ridiculous) but the Catholic church can get round that by extending the scope of baptism of desire.