There is a simple solution. When a state incorporates a work by reference into the law, there's a pretty cogent case that that constitutes a "taking" - ie, they've essentially seized the work for public use. Whichever legislature is doing the taking should cut a check to whomever they took the code from.
It would be a similar situation if, for instance, the Nevada legislature decided they were going to put on showings of Star Wars each night in front of the capitol, or erect a copy of a copyrighted sculpture.
It would be a similar situation if, for instance, the Nevada legislature decided they were going to put on showings of Star Wars each night in front of the capitol, or erect a copy of a copyrighted sculpture.