Lopez began as "son of Lope." Lope is a medieval Spanish given name from Latin lupus, "wolf," so the surname is a parent's-name label with an animal-name given name underneath—not a nickname invented for a wolfish personality after the fact.
Portuguese and Galician families often use Lopes. Jewish Sephardic lines sometimes adopted Lopez under Catholic naming pressure and retained it afterward. The US Census form is usually Lopez without the accent; the meaning still matches López.