Everything depends on a country whether gambling is a prohibited activity there or not.
If gambling in that country has a legal business permit law and there are no restrictions, then what the politician is doing is not a crime because he is in business to get some money.
Naturally, if he decided to take fair play in the gambling business so he could raise money to win in an election because the gambling business is a business with huge profits.
So the conclusion is that whatever business is done by politicians who are candidates in elections, if there is no prohibition on their business, then it is not a crime or mistake and we can also see that there are lots of government figures who take a fair in the gambling business in the country.
That is true, even though it's an unethical act to buy votes in an election since the right way is that the general public chooses the candidate by their own choice and will and not because they are being paid, but that is what happens in third-world and underdeveloped countries since there is corruption in everything.
As far as owning a casino is concerned, it basically can't be prohibited a person who is also a politician shouldn't or can't own a casino if the business is illegal within the country. A politician can use the money earned from any source for his bad doings if he is evil, so it isn't only because of the casino.
Even though buying people's votes in elections is an unethical act, this method is no longer a secret and many countries with politicians do it in order to be elected in elections.
Vote buying has become a culture in several countries that have a democratic system.
But if indeed the casino business is banned, there will still be a number of casinos still running because of the bribery of government people so that their casino business can still run.
Politicians who take a fair share in the gambling business can work behind the scenes so that no one knows that a politician is involved in the gambling industry.
Yes, and it's true what you said, when politicians want to do bad things to get some money, can be sure they have other sources of funding too.