I used to play the lotto, maybe a few times a month or every other month or so. I won a few bucks every now and then but never came close to making a profit.
I used to say to myself and to God that if He lets me win that I'd only keep a little, enough to live off of, and that I'd give the rest away, split it up and give generously to some trad priests/organizations and to some of the trads I know who are in need of funds for groceries and paying their bills etc..
But I eventually realized that it is for our eternal good that either God does not want me to give the others any money, or He does not want them (or me) to have that much money because in all likelihood, He knows winning would mean hell for me and those I gave it to. Also I know that He has taken care of them (and me) just fine up till now, so I really have no need whatsoever of that much money.
I think that if it is a sin to play the lotto, it is a sin because we insult God in our actions by playing the lotto because by doing so, we're telling God that He has not, and does not give us enough, and that we want more than He already so generously gives us.
OTOH, if winning would aid us in this journey toward salvation, I have every confidence that He would surely see to it that we win!
Haydock commentary for John 7:8 - Whatever we ask necessary to salvation with humility, fervour, perseverance, and other due circuмstances, we may be assured God will grant when it is best for us. If we do not obtain what we pray for, we must suppose it is not conducive to our salvation, in comparison of which all else is of little moment. (Haydock)