Because there is such a thing as prior art. If an invention exists and can be found by the patent examiner then it will not be granted, or if it is missed by the examiner then competitors could challenge it and have it overturned.
It isn't just if it hasn't been patented before, it has to be novel. I.e. new.
As /u/apollo888 points out, to be patentable, an invention must be novel. So even if the original inventor does not file for a patent, his publication on and public sale of the item will be evidence of prior art. That's covered under 35 USC 102. What people often forget, though, is that there is a second, more fundamental bar to obtaining a patent in your scenario, right there in 35 USC 101 it says,
Whoever invents or discovers any new and useful process, machine, manufacture, or composition of matter, or any new and useful improvement thereof, may obtain a patent therefor, subject to the conditions and requirements of this title. [emphasis added]
In other words, if you didn't invent it at all, you fail to satisfy both the novelty criteria under section 102, and the basic criteria that parents are issued to inventors, not random dudes who run to the patent office faster.