Convergent evolution is a phenomenon whereby similar traits evolved independently in not closely related species, and is often interpreted in functional terms. Spines in mollusk seashells are classically interpreted as having repeatedly evolved as a defense in response to shell-crushing predators. Here we consider the morphogenetic process that shapes these structures and underlies their repeated emergence. We develop a mathematical model for spine morphogenesis based on the mechanical interaction between the secreting mantle edge and the calcified shell edge to which the mantle adheres during shell growth. It is demonstrated that a large diversity of spine structures can be accounted for through small variations in control parameters of this natural mechanical process. This physical mechanism suggests that convergent evolution of spines can be understood through a generic morphogenetic process, and provides unique perspectives in understanding the phenotypic evolution of this second largest phylum in the animal kingdom.