Alex Tabarrok at Marginal Revolution makes a solid case that patent law should not allow someone with a patent to exclude someone who independently invented the same thing. Under current patent law, it is often illegal to use an idea you invented yourself because someone else who invented the same thing gets a patent on the idea.
U.S. Patent was was recently revised in exactly the opposite direction, joining most of the world in become a country with a pure "race" priority system, in which there is not even an inquiry into who invented something first - the first person to file a valid patent for an idea has exclusive priority. This makes the task of determining who gets a patent first easier, but begs the question of what is so bad about letting someone who develops an idea independently have their own patent. Of course, proving an independent invention once an existing patent for the same idea is already in the public record is a practical problem. But, on the other hand, if multiple different inventors are simultaneously and independently inventing the same thing (and this has happened frequently in the history of science and technology), perhaps some other recent discovery has made the idea obvious and it should receive weaker protection. Also, the idea that you can't commercialize your knowledge produced without reliance on other people's protected intellectual property is problematic.
Copyright law and trade secret law don't impose liability on people using independently invented ideas, although someone else using something identical to an existing copyrighted work or trade secreted idea will provide strong circumstantial evidence that the idea is derived from the protected work that will have to be rebutted with pretty convincing evidence.