DNA methylation is found throughout all domains of life, yet the extent and function of DNA methylation differ among eukaryotes. Strains of the plant pathogenic fungus Zymoseptoria tritici appeared to lack cytosine DNA methylation (5mC) because gene amplification followed by Repeat-Induced Point mutation (RIP) resulted in the inactivation of the dim2 DNA methyltransferase gene. 5mC is, however, present in closely related sister species. We demonstrate that inactivation of dim2 occurred recently as some Z. tritici isolates carry a functional dim2 gene. Moreover, we show that dim2 inactivation occurred by a different path than previously hypothesized. We mapped the genome-wide distribution of 5mC in strains with or without functional dim2 alleles. Presence of functional dim2 correlates with high levels of 5mC in transposable elements (TEs), suggesting a role in genome defense. We identified low levels of 5mC in strains carrying non-functional dim2 alleles, suggesting that 5mC is maintained over time, presumably by an active Dnmt5 DNA methyltransferase. Integration of a functional dim2 allele in strains with mutated dim2 restored normal 5mC levels, demonstrating de novo cytosine methylation activity of Dim2. To assess the importance of 5mC for genome evolution, we performed an evolution experiment, comparing genomes of strains with high levels of 5mC to genomes of strains lacking functional dim2. We found that presence of a functional dim2 allele alters nucleotide composition by promoting C to T transitions (C→T) specifically at CpA (CA) sites during mitosis, likely contributing to TE inactivation. Our results show that 5mC density at TEs is a polymorphic trait in Z. tritici populations that can impact genome evolution.