FRESNO, Calif.—Farmers here in the Central Valley, home to one of the country's richest agricultural regions, are grappling with a mounting problem: pot.

California's legalization of medical marijuana in 1996 and a crackdown on illegal marijuana crops in the nearby Sierra Nevada in recent years have led to an expansion of pot farms in the region's agricultural flatlands. This trend is alarming many farmers—both from the standpoint of seeing their region lose productive farmland as well as from an accompanying rise in violence...