Whenever you are designing a system, be it something in engineering, government, or otherwise, you always need to consider the unintended consequences of your design/policies. Sometimes these can be rather obvious, such as when you spend more money, you will need to collect more money so that you have it to spend (this may be delayed at additional cost in the case of borrowing, or you can also print it if you control the currency itself). Another classic recent example would be bailing out the large banks who took on huge amounts of risk in their pursuit of leveraged profits: by doing so, the government not only condoned the business strategy, but encouraged the banks to both take on more risk in the future, and essentially ignore the issue of divesting themselves of risky assets, both of which are proving more detrimental to the longer-term health of the US economy than their failures would have. Some are harder to anticipate, but rarely are the major ones difficult to see with even a moderate amount of consideration.
This story, then, illustrates another good example of a reasonably easily predictable outcome from a law, which I can only assume the legislators anticipated. To summarize, the laws in various states which criminalize texting while driving are causing more accidents. Ironically, this is similar to another set of traffic laws with unadvertised consequences: the red-light cameras causing more accidents (because it makes people more nervous and apt to drive more erratically around/through those intersections, obviously). In the texting case, drivers are moving their cell phones out of visible sight from outside the car, which causes then to divert their eyes further from the road while texting, causing more accidents. It's very reminiscent of the hand-held cell phone ban/law, which is causing drivers to hold their phones out of visible range and glance down while talking (although in that case it's a less severe problem, because you don't normally need to look at your phone while talking on speakerphone).
There are many other examples of these "unintended" consequences, of course. Obamacare will raise health care costs, drive providers out of business, lower the quality of service, and cost the country trillions: all of these are easily predictable. Socialism and wealth redistribution remove the incentive to work hard, reducing a country's economic output and innovation. An uncertain tax environment, punishing domestic tax rates, and onerous restrictions on business in the name of environmentalism (or other causes) all serve to drive business out of the country, reducing employment for Americans and industrial competitiveness for the country. The list goes on and on.
There are two schools of thought when it comes to these relatively obvious consequences: they are unintended, or they are merely unadvertised. In the first view, the politicians and their aids are dumb, they don't really understand what they are passing into law (or they don't read the legislation), and they don't ever consider the obvious effects of the policies they enact. In the other view, the people crafting the laws are not dumb, they have considered the implications, and they just don't publicize the fact that they know full-well what is going to result from the policies; they just don't want to advertise the effects, because they are not publicly palatable. It's hard for me to believe that everyone in government is monumentally stupid, even if I don't agree with their positions, so you can guess which side of the "unintended consequences" theories I come down on.
Who knows how much better the country would be if we had an independent news media, who could accurately point out all the obvious consequences of all the complex and intentionally opaque legislation that self-serving politicians advance to further their own agendas. Until then, though, I guess we'll have to live with the continuous absurd repetitions of "who could have known" and "that didn't work out as well as expected".