Having been around so long, it's difficult to say just how this whole floral figment originated. One could say it came out of the "blue," but he'd have to try harder to make that into a joke, and I personally have too much ground to cover.
So, with the help of Catherine Wusterhausen, who works in the Legislative Reference Library at the Texas state capitol, I discovered a possible origin to the myth. Catherine found for me Senate Bill 147 from the 28th Legislature, which took effect in 1903. Titled "Public Grounds — To Protect the Same," the bill made illegal, among many other things, the removal of vegetation from public property:
That from and after the taking effect of this Act, it shall be unlawful for any person or persons ... in any of the public grounds of this State ... to cut, pull, break, bruise, remove or in anywise injure any tree, or shrub or vegetation of any kind growing thereon.
This certainly would have included the removal of bluebonnets, though picking them on private property — with either ownership or permission — remained legal. Still, seeing as this law went into effect less than two years after the state flower was chosen, it's possible there's some connection here.
Incidentally, the previous passage went on to state that a person could also not "obscenely or indecently expose any part of his or her person." Doing so could cost anywhere from $5 to $100, depending presumably on one's showmanship.
Further research, however, revealed more promising passages in House Bill 47 from the 43rd Legislature, effective in 1933:
... It shall be unlawful for any person wilfully [sic] to pick, pull, pull up, tear up, dig up, cut, break, injure, burn or destroy any tree, shrub, vine, flower or moss growing upon the enclosed land of another, or upon any land reserved, set aside, or maintained by this State as a public park, or as a preserve, or sanctuary for trees, plants, wild animals, birds, or fish. ...
... It shall be unlawful for any person to transport, carry, or convey, on any public highway, or to sell or expose for sale in any place any holly, yaupon, smilax ... bluebonnets ... ferns, or moss which has been gathered, picked, cut, or dug in violation of this Act.
The full text names many more items, both specifically and generally, but here we've found the magic word: "bluebonnets." The only problem here is that the law now relates only to private land, state parks and nature preserves. It also continues to say it's all right as long as you've obtained permission from the relevant party. But at least here we have a specific reference to bluebonnets. Could this be the origin of the myth?
Possibly, but it doesn't really matter anyway, since all this became null when the Texas Penal Code was revised in 1973. And according to the aforementioned document provided by Joe Slocum, the only relevant legislation contained in the current penal code concerns the reckless damage and destruction of public property, which can be interpreted to include excessive removal or destruction of plant life. In other words, shoveling up stretches of topsoil to transplant wildflowers, a practice that is not uncommon, is certainly prosecutable.
As for picking a few simple bluebonnets, though, the document continues by reporting "The General Legal Counsel for the Department has advised that if an individual stops to pick wildflowers, they see nothing that could be considered a criminal offense." Continued ...