The evidence is extremely varied, and in my opinion unreliable for making serious claims. Commonly cited by those repeating these claims, which as others have pointed out is rife with issues pertaining to causality, is the 2004 study "Ejaculation Frequency and Subsequent Risk of Prostate Cancer" published in the Journal of the American Medical Association (JAMA).
Here is a section summarizing what came before:
> Previous investigations on reported ejaculation frequencies or sexual intercourse and prostate cancer are limited to studies of retrospective design and results are mixed. Nine studies observed a statistically significant or non-significant positive association; 3 studies reported no association; 7 studies found a statistically significant or non-significant inverse relationship; and 1 study found a U-shaped relationship.
Conclusions that come from the aforementioned article, as well as many/most/all others that I have encountered, are mixed and, as others have noted, have issues with determining causes.
Here is a section summarizing what came before:
> Previous investigations on reported ejaculation frequencies or sexual intercourse and prostate cancer are limited to studies of retrospective design and results are mixed. Nine studies observed a statistically significant or non-significant positive association; 3 studies reported no association; 7 studies found a statistically significant or non-significant inverse relationship; and 1 study found a U-shaped relationship.
Conclusions that come from the aforementioned article, as well as many/most/all others that I have encountered, are mixed and, as others have noted, have issues with determining causes.