On 27 January 2017, seven days into his first term, Donald Trump issued Executive Order 13769: "Protecting the Nation from Foreign Terrorist Entry into the United States." 
The American news media widely proclaimed that Trump had banned travel from seven "Muslim majority countries" and referred to the order as Trump’s "Muslim ban." Every time the countries were mentioned they were invariably described as "Muslim majority," even though this was not the criteria by which the countries were chosen, and the news media must have known this fact. Yet they tried to use this Executive Order as evidence that Donald Trump was racist against Muslims (a phrase that doesn’t even make sense on it’s face, as Islam is a religion not a race).
The executive order, and it’s subsequent replacements and modifying proclamations did not mention the terms "Muslim", "Islam", or indeed anything at all about either religion or race. 
In fact, the executive order doesn’t even mention the names of the countries it affected, except for Syria . The original Executive Order affected these seven countries: Iraq, Syria, Iran, Sudan, Libya, Somalia and Yemen.
Trump did not choose the countries it affected. Those countries were already determined by Congress and Homeland Security under the Obama administration and were already under a lighter form of travel restrictions. Trump’s order referred to the pre-existing law. The countries were chosen because they were the ones determined by Congress and Homeland Security (and later in concert with the State Department and the intelligence agencies) whose governments repeatedly provided support of acts of international terrorism (8 U.S.C. 1187(a)(12)(A)(i)(II)), and later on preventing entry of nationals who cannot be adequately vetted, such as to induce other nations to improve their practices . The part of the original executive order that references the countries reads as follows: "I hereby proclaim that the immigrant and nonimmigrant entry into the United States of aliens from countries referred to in section 217(a)(12) of the INA, 8 U.S.C. 1187(a)(12), would be detrimental to the interests of the United States, and I hereby suspend entry into the United States, as immigrants and nonimmigrants, of such persons for 90 days from the date of this order." .
8 U.S.C. 1187, mentioned in the executive order was amended by H.R. 158 on December 9, 2015, by congress during the Obama administration . H.R. 158 was titled the "Visa Waiver Program Improvement and Terrorist Travel Prevention Act of 2015". That act specifically named Iraq and Syria, but it also included any "country that is designated by the Secretary of State ... as a country, the government of which has repeatedly provided support of acts of international terrorism...". (8 U.S.C. 1187(a)(12)(A)(i)(II)). So this by reference included Iran and Sudan. A few months later on 18 February 2016, the Department of Homeland Security (DHS) identified three additional countries that would also be covered by the limitation on Visa Waiver Program travel, those being Libya, Somalia and Yemen, because in those countries the government "has repeatedly provided support of acts of international terrorism" (8 U.S.C. 1187) . And thus the seven countries were identified and travel restricted more than a year before Donald Trump took office.
H.R. 158 terminated travel privileges of all citizens of Visa Waiver Program countries who were also dual-citizens of any of the countries that H.R. 158 banned. For this reason, the ACLU opposed H.R. 158, but it passed in congress as a rider attached to an omnibus spending bill. Again, this was before Trump took office.
Trump’s executive order only affected 8%  of the world’s Muslim population, and only 7 (later 8) Muslim majority countries among 45-51 of them (depending on how you count). 
As the government became more adept at identifying which countries presented the most risk of terrorism, subsequent orders and proclamations changed the list of countries. Executive Order 13780 on March 6 replaced the original one. A further proclamation in September 2017 based on a review by Homeland Security, the State Department and the intelligence agencies changed the risk assessment baseline and thus altered the countries affected to the following: Chad, Iran, Iraq, Libya, North Korea, Syria, Venezuela and Yemen.
Given all of that, how is it possible that the news media interpreted this as a Muslim ban?
Probably because Trump has expressed a willingness to ban all Muslims. Trump made categorical statements during his campaign regarding Muslims and Islam such as "Islam hates us", that the United States was "having problems with Muslims coming into the country." He even published written statements, such as the "Statement on Preventing Muslim Immigration" that called for a "total and complete shutdown of Muslims entering the United States until our country’s representatives can figure out what is going on." It was these statements, not the text of the legislation, that led people to believe that Trump intended the Executive Order as a means of banning Muslims. And it was only one more small illogical leap to believe that he was banning them because they were Muslim, rather than because America coudln't distinguish the terrorists from the non-terrorists.
This issue became so contentious as to spawn nearly 50 legal actions. Justices in the Fourth and Ninth circuit ruled against Trump on the opinion that Donald Trump issued the order based upon religious animus and thus it amounted to a violation of the Establishment Clause of the First Amendment (Actually the Ninth Circuit used INA section 1152(a)(1)(A) which states that "no person shall... be discriminated against in the issuance of an immigrant visa because of the person’s race, sex, nationality, place of birth, or place of residence." The Ninth Circuit did not reach the Establishment Clause claim.) But in the Fourth circuit "the majority concluded that the primary purpose of section 2(c) was religious, in violation of the First Amendment: A reasonable observer familiar with all the circumstances--including the predominantly Muslim character of the designated countries and statements made by President Trump during his Presidential campaign--would conclude that section 2(c) was motivated principally by a desire to exclude Muslims from the United States, not by considerations relating to national security."  Even the Supreme Court was divided 5-4 on this issue. But the majority opinion was in favor of Trump .
I find the evidence is pretty strong that the order was enacted because these particular Islamic countries have repeatedly supported acts of international terrorism. It is quite a different thing to be against Islam itself and all Muslims, than it is to ban a specific subset of Muslims because they cannot currently be adequately distinguished from terrorists.
If a surgeon removes a cancerous section of the colon, it’s not because the surgeon has an animus towards the colon, but because the colon contained cancer. If you keep this in mind while listening to or reading Trump, you’ll find that it is always about the terrorism, and not about denigrating the religion, but also that he speaks in broad generalities and can often be misunderstood.
Reading Trump more closely, we can see that he only wanted to ban Muslims "until our country’s representatives can figure out what is going on," which seems to indicate a desire to find a better way of identifying terrorists. The executive active was temporary over only 90 days.
If Trump had banned Muslims based on their religion like he wanted to, this would surely have violated the first amendment, except insomuch as foreigners are not protected under the US Constitution. But even if he had gone that far, such an act would still not have demonstrated an animus towards Muslims. If I apply a tourniquet to my arm because it is bleeding, this does not demonstrate an animus towards my arm, but only that the most effective intervention to stop the bleeding is to stop the blood flow to the entire arm.
Nonetheless, the media propaganda was so effective as to sway four dissenting Supreme Court justices (Sotomayor, Ginsburg, Breyer and Kagan) who felt the evidence of anti-religious bias was strong enough to dissent from the majority opinion which ruled in favor of Trump. Two circuit courts also held similar views. 
Yes, I claim those dissenting justices’ opinions are unreasonable. I read them. They are wrong. Sotomayor took Trump’s quote out of context so as to avoid exposing the exculpatory evidence. It seems to me Breyer and Kagan wrote their own opinion so as to distance themselves from the clearly activist opinion of Sotomayor and Ginsberg, yet in the end concurred with Sotomayor without explicitly stating why. This is activist judicial behavior at it’s finest.
If such a travel restriction was racist, why didn’t the news media sound the alarm in 2015 under the Obama administration, when it first came into effect? Why didn't they report that the travel ban was just extending a previous one? Why did the news media not report the criteria under which the countries were selected? Why did the news media always refer to the countries as "Muslim majority countries" rather than countries whose governments support terrorism and who do not have adequate vetting processes for their citizens? Why didn’ the news media point out that Trump didn't choose the countries?
The American news media is not your friend. While they are informing you, they are also misleading you and manipulating you. And they are highly effective, able even to manipulate four Supreme Court justices’ opinions. You need to be on guard.
 Executive Order 13769 - https://www.federalregister.gov/documents/2017/02/01/2017-02281/protecting-the-nation-from-foreign-terrorist-entry-into-the-united-states, https://www.whitehouse.gov/presidential-actions/executive-order-protecting-nation-foreign-terrorist-entry-united-states/>
 H.R. 158 - Visa Waiver Program Improvement and Terrorist Travel Prevention Act of 2015 https://www.congress.gov/bill/114th-congress/house-bill/158/text.
 Supreme Court 16-1436 Trump v. International Refugee Assistance Project https://www.supremecourt.gov/opinions/16pdf/16-1436_l6hc.pdf
 Supreme Court 17-965 Trump v. Hawaii https://www.supremecourt.gov/opinions/17pdf/17-965_h315.pdf