How could the USSR have invaded Afghanistan for the same reason as the US?
The USSR was there to oppose the US by fighting their proxies and defend the socialists in Afghanistan who supported them during the invasion.
The US invaded under the War on Terror pretext as a war profiteering entrerprise. They brought Unaco, Haliburton, KBR, PMCs, and other contractors in to extract value from the region to bring profits to the imperial core.