There is not a single extraneous character recorded in the Torah (Matthew 5:18). Every word is written for a purpose, and there is nothing wasted. This is one reason why the names of wives are rarely mentioned: not because women were considered unimportant, but because their names were not significant to the point being made. So when the names of Lamech’s wives are given without further information about them in Genesis 5:19, we should immediately ask why.
As a descendant of Cain and a probable murderer, Lamech is often used to argue that God does not approve of polygamy. “See? The first recorded polygamist was also a murderer and of the line of Cain. It must be wrong!” This kind of reasoning is based on the Law of First Mention, which is a theological land mine all on its own (see here), but apart from that, they are ignoring some important details in the story.
Lamech’s wives names can be translated roughly as “ornament” and “shadow.” Ornamentation is a symbol of wealth and shadow is often used in scripture to symbolize a powerful patronage. Could Lamech’s wives symbolize wealth and power as mulitple wives often do? Perhaps one father-in-law brought him great wealth, and the other was a king or warlord. Lamech’s declaration that he would be avenged seventy-seven times was a declaration of independence from God and immunity to the vengeance of men. He believed his access to wealth and power provided him with greater protection than God.
The point of Lamech’s story is not to highlight the evils of polygamy, but rather the evils of pride and the abuse of power.