It's not _just_ because you invented it earlier, you also have to disclose it in a way that makes it workable. The disclosure is supposed to drive innovation and use of innovations; that's the patent deal, the monopoly is "paid" for with disclosure.
Aside, in the UK there's compulsory licensing (UKPA Section 48x to prevent people from inventing stuff and refusing to license it (at reasonable terms), too.