You asked why that would be a problem, not that we agree. I like your point of view but I think in general society is less diverse than our personal experience. At least in my country, which is a mix of very liberal and very conservative (Brazil), most recruiters would discriminate against gambling and porn, not by the other tech people but from the other areas of the company. Less likely to happen in a full tech company.
There's also the issue of money. If you are turned down for a job that would have paid 20% more because of working in a controversial industry that can have a big impact on your life. I'd prefer to be able to have civil discussions about politics with coworkers, but I don't care enough to sacrifice even 1% of my salary. This entire Ask HN is about income maximizing after all. I think getting into vice or anything controversial is a bad long term move, even if it includes a sizable temporary bump in compensation.
If you don’t take a job that would pay more you are also hurting your income opportunities. Turning a job down because of some hypothetical problem at some future date isn’t rational imo.
If you genuinely believe certain industries would hurt your future job prospects, you need to quantify the risk. And I have a hard time believing the particular industry would matter at all to an employer. If you can build CRUD apps for a gambling company you can build CRUD apps for a pediatric cancer charity.