Companies aren't testing for this because they couldn't care less. Drugs isn't killing their business and they like having access to smart people who might fail a test. The main reason testing is more common in the public sector is not that drugs are bad but that the optics of people using drugs has negative political consequences when political leaders are waging this war on drugs. Also with drugs being illegal, using them necessarily means breaking the law and interacting with criminals. Which looks bad politically as well.
Remote work is different. People and companies disagree about the effects but a lot of companies seem to prefer having their people not work remotely. Not because of the way it looks but because of at least the perception of its impact on productivity. Whether you agree with that or not doesn't matter. Some people are concerned about it and acting accordingly.
The inequality here relates mainly to the value of the work people do. Just like companies don't like losing access to people who are smart and may use drugs, they also don't like losing access to people who have valuable skills that insist on working remotely. So they allow some people to work remotely. But of course some skills are more valuable than others so the inequality mainly relates to how easy it is to replace people with more compliant ones.