Probably shouldn't marry someone who was gonna fuck any random who drew a piece of paper...
Inori serves and worships the shrine's kami. According to the kami's messenger, she also possesses the power to grant wishes. And the lottery's result will depend on the power of sexual desire.
In this sense, it isn't random at all. It's a test of both faith and passion. The two young lovers pass, of course, and are in the end quite lewdly rewarded.
I think it's an excellent story, provided one can suspend disbelief when it comes to Shinto kami and their magic.