The reason lies in the way cancer operates. Cancer starts with a mutation in a cell's DNA. Most of those mutations happen when a cell is dividing: every division requires making a copy of the DNA, and those copies aren't always perfect. It requires further copies still to pass that mutation to daughter cells, so even more cell division has to take place. That's why cancer happens so often in organs that need to replace their cells frequently, like the skin and colon. But your heart's cells almost completely stop dividing after they've formed in the womb, except to replace damaged or injured cells. That means that even if there is a mutation, it'll have a hard time spreading.
There are other things that can cause mutations that lead to cancer, too. UV radiation can cause skin cancer, carcinogens in your food can cause colon cancer, and even estrogen in the breasts can trigger a malignant tumor. The heart, however, isn't exposed to many carcinogens, so there's little worry of harmful DNA mutations. Learn more about your heart and how cancer works in the videos below.