Pathogens have evolved diverse strategies to maximize their transmission fitness. Here we investigate these strategies for directly transmitted pathogens using mathematical models of disease pathogenesis and transmission, modeling fitness as a function of within- and between-host pathogen dynamics. The within-host model includes realistic constraints on pathogen replication via resource depletion and cross-immunity between pathogen strains. We find three distinct types of infection emerge as maxima in the fitness landscape, each characterized by particular within-host dynamics, host population contact network structure, and transmission mode. These three infection types are associated with distinct non-overlapping ranges of levels of antigenic diversity, and well-defined patterns of within-host dynamics and between-host transmissibility. Fitness, quantified by the basic reproduction number, also falls within distinct ranges for each infection type. Every type is optimal for certain contact structures over a range of contact rates. Sexually transmitted infections and childhood diseases are identified as exemplar types for low and high contact rates, respectively. This work generates a plausible mechanistic hypothesis for the observed tradeoff between pathogen transmissibility and antigenic diversity, and shows how different classes of pathogens arise evolutionarily as fitness optima for different contact network structures and host contact rates.