Publication of an intercepted cable exposed a clumsy German effort to forge an alliance with Mexico and helped propel the United States into the Great War.