The most possible reason why Shaw made Frank confess to gambling in Act IV of Mrs. Warren's Profession is to give an otherwise incorrigible character some redeeming characteristics.
We know as readers that even Frank's father thinks ill of Frank.
I advised you to conquer your idleness and flippancy, and to work your way into an honorable profession and live on it and not upon me.
Frank does not follow his father's advice. He is spoiled, lazy, amoral, bratty and disrespectful. Moreover, he does not generate an income in any way and in the play he even hints at selling himself for money if possible.
While confessing to gambling is not redeeming in the traditional sense of humanizing his character and making it more likeable, it at least does the effect of making Frank look slightly useful. It is like saying: "Oh? Frank can at least play poker?" That would match the flippant attitude he had toward Vivie at the beginning of the act, which would be an unfair attitude because Vivie is obviously useful enough to earn her own keep.