It's awesome that you're thinking about this stuff though. I think you'd get a lot out of this: https://www.khanacademy.org/science/high-school-biology/hs-r...
The mechanics of it, is like I said, the population bottleneck. Cancer cells are parasites and the bottleneck leaves them without a host.
A fascinating cancer is "Devil facial tumour disease". It has learned to spread from animal to animal, thus bypassing this purifying mechanism. But as it no longer consists of the animals' own cells it may be argued that it has become its own species and should no longer be considered a cancer. Supporting the speciation argument is the fact that the cancer cells even have a different amount of chromosomes from the animals.
This isn't a determinist "cancer will form or it won't" situation-- there's a lot of variance and luck. Furthermore many cancers form later in life, after people have already reproduced, so natural selection doesn't have that strong of a hold on it. If cancer worked the way you think it did, don't you think that cancer would have been naturally eradicated during our evolution?
Heads and that cell is healthy and the healthy cells win. Tails and that cell has cancer and is stillborn and cancer loses.