It's easy to legislate a preference for Open Source, and difficult to implement a level playing field upon which Open Source and proprietary software could compete fairly. Thus, a number of governments have enacted the preference as an easy-to-legislate way of solving the problem, but I submit not optimally. Having a preference gives proprietary software an opening to portray themselves as the "injured party", when the reality is that historically there has been a preference for proprietary software in both legislation and internal process of government purchasers, and this still exists today.
What would we need to implement a level playing field for Open Source and proprietary software to compete fairly?
Software patents discriminate against Open Source because Open Source developers do not themselves collect royalties for their copyright rights, and thus can't pass royalties on to patent holders. In general, software patents encourage litigation rather than innovation, as can be shown by the tremendous amount of innovation in Open Source today, which operates without the collection of royalties.
Historically, proprietary software vendors have used incompatibility to limit the options of their customers: Once you've installed an important but non-interoperable product, its incompatibility limits what other products you may buy to those that implement the proprietary format or protocol. To change direction, a customer must replace all software, taking so much time and money that few ever try.
Open Standards are best, but they take time to develop. Governments should prefer the use of Open Standards that can be implemented by both proprietary and Open Source software. They should require that the file formats and intercommunication protocols of the software they buy be publicly documented, and available for anyone to use without royalties or discriminatory licensing. An insistence on documentation and the applicable rights allows innovation to take place more quickly than if vendors were required to wait for the completion of a standard, but there is no excuse for gratuitous use of new formats and protocols when appropriate Open Standards already exist.
It's been obvious, whenever I talk with government, that there's a well-staffed Microsoft lobbying organization nearby, as well as intermediaries who act for them like CompTIA. Against them, there's been a low or no-budget representation for Open Source, sometimes just me all alone. And of course the proprietary software companies can afford more advertising and they create lavish events to promote themselves.
To level out this situation, and many others, we need required public reporting of all lobbying, including the parties present, the time and duration of the meeting, and the topics discussed. The general public should be able to see that information on the internet with no more than a day's delay, if they are to have a chance to offset the effect of the deep-pockets lobbyists.
In addition, there needs to be legislation protecting and promoting the access of the less-grandly-funded to those in government who have or will receive other lobbies, so that there can be balance of representation.
It should not be permissible for a government purchase decision to fail to evaluate Open Source alternatives, even if there is no preference for such alternatives.
Once we have implemented these provisions for fairness, a direct preference for Open Source would not be necessary. I believe that Open Source will win a majority of software acquisition decisions on a fair playing field.