Obama said he will replace McChrystal with General David Petraeus, who led a high-profile offensive against insurgents in Iraq.
McChrystal had earlier announced he was standing down after he had discussed the content of the Rolling Stone article with Obama at the White House. In the magazine interview, McChrystal had mocked Vice-President Joe Biden and said he had been “disappointed” by his first meeting with Obama.
"As difficult as it is to lose General McChrystal, I believe that it is the right decision for our national security," Obama said.
The US President praised the four-star general's "remarkable" career but then elaborated on why he had been dismissed.
"The conduct represented in the recently published article does not meet the standard that should be set by a commanding general."
Obama said McChrystal's comments had undermined "the civilian control of the military that is at the core of our democratic system.”
"And it erodes the trust that's necessary for our team to work together to achieve our objectives in Afghanistan."
Obama said unity was vital if Taliban insurgents were to be defeated in Afghanistan.
"I've just told my national security team that now is the time for all of us to come together. Doing so is not an option but an obligation. I welcome debate among my team but I won't tolerate division."
In a statement released after his meeting with Obama, McChrystal outlined the reasons he had agreed to step down.
"I strongly support the president's strategy in Afghanistan and am deeply committed to our coalition forces, our partner nations, and the Afghan people," he said. "It was out of respect for this commitment - and a desire to see the mission succeed - that I tendered my resignation."