If you make sufficient disclosure part of the patent system then this is the only way to do things really. If you don't require it then patents are worthless for the [general populous of the] state.
Intentionally infringing a patent is punished much more harshly, and it's impossible to keep up with the millions of patents that are published, so being intentionally unaware is actually a decent legal defence.
And yes, this does mean that patents are generally pretty useless for software.
A patent is filed for technique X by company A,
Company B use technique X having created it independently,
The patent is issued to Company A,
Company B is now infringing upon Company A's patent.
Company B could not possibly have committed patent infringement intentionally, because the patent they infringed didn't even exist when they went about implementing their product.
I don't know about the US situation but in the UK Section 64 of the Patents Act (http://www.ipo.gov.uk/pro-types/pro-patent/p-law/p-manual/p-... and http://www.legislation.gov.uk/ukpga/1977/37/section/64) allows a person to continue activity which was started prior to the grant of a patent in secret or where sufficient preparations for that [infringing] activity were made prior to the application/grant in good faith. If the activity wasn't in secret then it forms part of the prior art and invalidates, or forces amendment of, the patent in question.
If there isn't an equivalent US clause I'd be surprised: 35 U.S.C. 273 "Defense to infringement based on earlier inventor." looks like a candidate.
For the sake of argument, imagine I can prove that I came up with an idea for something on my own. I'm completely unaware that it has previously been discovered and patented. I did not even think it was an idea that could be patented. Did I intend to infringe that patent?