Way back when, Garry’s Mod was free. (V9) Valve made Garry and his team of 3 an offer- they could sell the mod for blah, and Valve would get $5 per sale. That was all they asked. For this, Garry would get full access to the engine in whatever way he needed. This allowed many things to be done, obviously, including adding Lua and all the fun tools and addons you see today.
However, Black Mesa could be sold, but it’d be hard to figure out how to pay all the devs, how much to pay them, how much Valve should get, etc. If the devs want to go through all of that, then they could be able to sell the mod.