To the extent that a cell’s becoming cancerous is a result of the expression of the cell’s own (in this case, mutated) DNA, yes, cancer is genetic. There is of course an environmental component as well, though. All things being equal people that are exposed to many carcinogens are going to be at greater risk than those who aren’t.
As far as the “flaws are already in the genes” what I was trying to say (badly) was that the genes that make a cell cancerous are necessary early in our development. As embryos, our cells need to divide many times in a relatively undifferentiated state, and they need to be able to move around to different parts of the body. After we are past a certain stage of development our cells are supposed to behave “normally” for ever after: stop dividing, differentiate into specialized types, and stay where they belong in the body (lung cells stay in the lungs, liver cells in the liver, etc).
These embryonic genes are supposed to be turned off forever, but they can’t be eliminated from the body. The information is still there and if the wrong chain of events takes place (genetic predisposition, environmental triggers) your non-dividing, differentiated, stay-at-home "adult " cells can become undifferentiated metastastizing embryonic cells again.
Like I said, these properties are critical at one stage of our existence, even though they can kill us later. Evolution doesn’t care, because enough human beings reproduce before cancer kills them that it hasn’ been selected against.
I hope this is clearer. It really isn’t coming out as lucidly as I’d hoped.