Sometimes things happen. There are numerous environmental and genetic factors that can lead to cancer, and who knows what may have been the case with this fellow. Many, many dogs nowadays lose their lives because of cancer, and unfortunately with some it happens at an early age. Keep an eye on your pup, but it' something that either will or won't happen. You can take measures to prevent it, but not everything can be prevented :(
You mention, however, that you have the pup's mother. To be safe, I would ensure that these dogs don't produce anymore offspring. If it is a genetic thing then it's not something you want being passed around! Could have been environmental, something on the father's side, you never know.