Agree with you on this. Responsibility can help us reshape ourselves into our better version. Not true for everyone but most of the times when a man marries he takes up his family responsibilities without any hesitations. Especially the older child does this. Taking care for his families, making daily needs, having a roof under he and his families becomes the main concern. Whatever the things he did in the past before marriages, doesn't concern him anymore. As for gambling habits, it vanishes with time because he has a family to take care of. Family always comes first in term of priority.
Having responsibilities in the form of a family can really change a man. It doesn’t always happen but commitment in the form of marriage could give the man a sense of responsibility and could help mend his ways.
Even with gambling, a man that gambles before he gets married may reduce or outrightly quit the habit due to his new found responsibilities that would help curb any bad habits he may have had. Like you noted, family always comes first and is always a priority.