My wife wants to play a slot machine for about 15 minutes. She wants to give any money she might win to those in our community who are needy. This does not affect our regular contributions. This will be a one time occasion.
I am personally not comfortable with her doing this but she sees no harm in a one time occasion. If I agree to be a part of this, what does that say about me? I want no secret sin in my life and she does not either. Are we setting the right example for others if they find out?
The root problem is that your wife is not convinced that gambling is wrong. Imagine someone making similar arguments for some other sin, such as lying or stealing. See:
What particularly struck me is how your wife thinks to justify something she knows to be, at minimum, questionable.
It is only for a short time
How long an action is done doesn't determine whether it is sinful or not. Most sins don't take all that long to commit. How long does it take someone to commit murder or to tell a lie?
It will do good
Morality doesn't change based on intentions. Even if we were trying to do good, something sinful remains sinful. For example, David wanted to bring the ark of God to Jerusalem, but he didn’t move it in accordance with God's laws. He put it on a cart instead of being carried by poles on the shoulders of priests. As a result, a plague was sent upon Israel for David's sin (II Samuel 6:1-10).
It was this very excuse that God forestalled by not permitting contributions to the Temple from prostitution (Deuteronomy 23:18).
It won't cause harm
This excuse is used to excuse sexual sins. “It was consensual,” "No one was hurt," and so it is argued that it wasn't wrong. But Paul points out that even if no else was harm, your soul was damaged by your sin (I Corinthians 6:13-20).
It is only one time
Achan only stole one time that we are told about, yet he and his family died because of his sin (Joshua 7:25-26). David committed adultery with Bathsheba just one time and it led to her husband's death, the death of their child, and a coupe by one of David's sons (II Samuel 11-12). How many times something is done doesn't determine whether it is righteous or not.