Code itself has no value. It's just text, numbers and symbols. It gains value by solving an actual problem. And if it does so, market will be ready to pay for it.
They could just as well give tax-benefits for those who scribble a few pages full with text or drawings, and place that under public domain. It would be just as ridiculous.