Lewis and Short connect lex to ligo instead of lego.
Either way, the word lex seems to have no visible connection to collecting or binding or anything like that.
Perhaps a law was originally considered to be a collection of edicts or something that binds people?
Either verb makes some sense.
How a word like lex evolved to mean what it means is a good question, but can be too difficult to answer.
The entry in L&S makes no mention of any meanings that would be closer to an "underlying meaning".
This seems to be yet another word that has cut its ties to its own etymology: its history does not dictate what it is but it has started an independent life of its own.