While we do not know the identity of the man killed, we see here Lamech's (perverted) idea of justice.
From the NET Bible
sn Seventy-seven times. Lamech seems to reason this way: If Cain, a
murderer, is to be avenged seven times (see v. 15), then how much more
one who has been unjustly wronged! Lamech misses the point of God’s
merciful treatment of Cain. God was not establishing a principle of
justice when he warned he would avenge Cain’s murder. In fact he was
trying to limit the shedding of blood, something Lamech wants to
multiply instead. The use of “seventy-seven,” a multiple of seven, is
hyperbolic, emphasizing the extreme severity of the vengeance
envisioned by Lamech.
Lamech has taken two wives. In the verses just before, we see that people have learned to shape metal and some have become nomadic shepherds. We are seeing here the decline of human ethics/morality/justice even as their technology and skill increase.