But nobody is compelling anyone to write and release software. It's no different to requiring food to include a list of ingredients or products to include safety standards references etc.
I mean, there's a reasonable argument that large swathes of current copyright law in the US also violate the First Amendment. I haven't read it yet, but the book No Law from Stanford University Press[1] makes that argument and has been on my to-read list for a while.