Enough said about keeping water in the bowl of your toilet....
The insects probably hatched from eggs and came from anywhere. It only takes 1 insect to lay an entire colony! To get rid of them, simply spray with a Raid flying insect killer of any kind (fog the room real good), flush your toilet bowl, clean under the rim (even if it looks clean already), and keep the flapper on the toilet closed holding water. In a few days, spray again (fog the room). If insects form again, all you can do is keep spraying until all eggs are hatched and the young are killed.
Remember to sweep up the dead bugs!