The evolutionary forces shaping within- and across-species variation in the investment in male and female sex function are still incompletely understood. Despite earlier suggestions that in plants the evolution or cosexuality vs. dioecy, as well as sex allocation among cosexuals, is affected by seed and pollen dispersal, no formal model has explicitly used dispersal distances to address this problem. Here, we present a game-theory model as well as a simulation study that fills in this gap. Our model predicts that dioecy should evolve if seeds and pollen disperse widely and that sex allocation among cosexuals should be biased towards whichever sex function produces more widely dispersing units. Dispersal limitations stabilize cosexuality by reinforcing competition between spatially clumped dispersal units from the same source, leading to saturating fitness returns that render sexual specialization unprofitable. However, limited pollen dispersal can also increase the risk of selfing, thus potentially selecting for dioecy as an outbreeding mechanism. Finally, we refute a recent claim that cosexuals should always invest equally in both sex functions.