Many countries that regulate immigration have policies that exist to prevent immigrants from working without authorization. The theory behind this is that large numbers of immigrants working can disrupt the labor market of the host country, which could negatively impact native workers in that country. You may or may not find this theory persuasive; there is certainly plenty of debate about whether such policies are wise.
The H1-B program is supposed to be for highly skilled immigrants to do a specific job that it is difficult to find Americans willing to do. The H4-EAD visa is supposed to compliment that program by allowing dependent spouses immigrate to the United States. By definition, dependent spouses are ones who do not have their own income, e.g. they do not work.
In May of 2015, the US Citizenship and Immigration Services changed the rules to allow H4 visa holders to apply for work if they meet certain criteria. The result of this rule change was for many thousands of people with H4 visas to apply for work. This caused several activist groups in the United States to sue the government, because they believe that this rule change hurts domestic IT workers and that USCIS was not allowed to make this rule change. Since then the rule has been debated.
If you want to read more about this particular bit of policy change you can find more here: https://redbus2us.com/h4-ead-latest-news-updates-rule-removal-timeline/
With that out of the way, to more directly answer your questions:
First, why are the dependent migrants not allowed to work?
In the most general terms, because they wouldn't be dependent if they were, and because countries typically restrict immigrant labor for the benefit of their current domestic labor. If the current policy limits immigrant labor to certain numbers of people every year, under the (dubious) theory that having too many immigrants working is bad, letting dependent spouses work potentially doubles that limit, potentially leading to a bad outcome.
Second, if the reason behind them not allowed to work comes from a rational thinking, why does the author here say that it is an increasingly hostile political environment for the migrants ?
Because it involves a change in the existing US policies on immigration that coincide with the change between the Obama administration and the Trump administration. The Trump administration appears to be more sympathetic to these kinds of arguments about restricting immigrant labor than the previous administration.
There is plenty of room for debate on whether or not restricting immigrant labor is based on "rational thinking." Some people believe that it is not rational at all, specifically that limiting labor in this way does not make economic sense. Other people disagree. Generally, these sorts of disagreements stem from debates about whether having more people in the country (and which kind of people) is beneficial or costly. That's a very complex topic.