As President Barack Obama nears the end of his presidency, he’s taking particular delight in a foreign policy that, as he sees it, kept America out of foreign entanglements. Yes, there was that messy business with Libya, but aside from that the president feels that his non-emotional, not-excitable temperament – his ability to remain even-keeled through every storm – allowed him to withstand the pressure to use force in Syria or have American troops keep the peace in Iraq or Afghanistan. The president expressed it best when he spoke at West Point and said that the essence of his foreign policy is “don’t do stupid stuff.”But then came the shocker of Brexit, the upending of the president’s cherished dreams of a multi-cultural, multi-ethnic world. Little did he realize that by doing nothing in Syria and creating the greatest humanitarian crisis of our time, his actions would lead indirectly to Britain voting to exit the EU, a catastrophic blow to the notion of a world without borders.Why did Britain vote to leave the EU? Primarily over the issue of immigrants. Yes, there is the nightmare of EU regulatory hell, and yes, there are those who simply wanted the UK to regain its independence. But the pivotal issue was immigration, primarily from Eastern Europe and the Middle East.German Chancellor Angela Merkel brought in a million Syrian refugees. That was virtuous, but there was no chance of them being vetted, and with the terror attacks in Paris and Brussels, Europeans and Britons were getting concerned.Many portrayed this as racist. Perhaps it was; I myself have written that the United States should take in Syrian refugees whose lives are threatened, albeit after making efforts to vet them.But it was President Obama who allowed this greatest of all humanitarian crises to unfold. Had he taken action in Syria, had he at least created a no-fly zone to stop the indiscriminate slaughter of more than 250,000 innocent Arabs, millions would not have been forced to flee their homes.There are two kinds of sins in the world: sins of commission and sins of omission. The bad things we do and the good things we fail to do.President Obama didn’t want to do stupid stuff. He didn’t want to make the same mistakes, as he saw them, of George W.Bush. But in overlearning the lessons of Iraq and Afghanistan he was guilty of great sins of omission, allowing the genocide of the Yazidis and the beginnings of genocide in Syria to unfold under his watch.We should all try not to do stupid stuff. But we should be equally careful not to fail to do good stuff.How ironic that in fearing a terrible error that might come about because of American intervention, President Obama allowed the displacement of millions of people as they sought sanctuary elsewhere.Moral countries should always do their utmost to take in refugees, but they should do even more to prevent people from becoming refugees in the first place.If it is true that president Bush miscalculated in the number of troops he needed to invade and hold Iraq, then it is equally true that President Obama made a catastrophic mistake in doing absolutely nothing in Syria.There was no need to send troops into Syria. The US could have supported moderate rebel troops before Islamic State (ISIS) began to conquer large swaths of the country and after Syrian President Bashar Assad used poison gas on children, as the president himself had promised.President Obama’s sin may be the greater of the two. He had far more international popularity that president Bush and could have put together an international coalition to take action to stop the mass slaughter in Syria. But in seeing American power as fundamentally disruptive, and in seeing military intervention as quagmire, the president allowed millions to lose their homes and seek refuge in Europe, provoking the kind of backlash we are now witnessing in Europe in general and Britain in particular.Let me be clear: I do not condone bigotry or xenophobia of any stripe and have spoken out publicly against any attempt to ban Muslims from entering the US, an act that would fundamentally violate foundational American values and principles. But I equally understand the sentiment that a mass migration of peoples who may contain ISIS terrorists is something that will be opposed by most nations, who will legitimately demand that there be the most basic of vetting.I have earlier written that the foreign policy of President Obama is fatally flawed by the president’s seeming absence of hatred of evil. It’s one thing to reopen diplomatic relations with Cuba. It’s another thing to eat hot dogs at a baseball game with dictator Raul Castro. It’s one thing to negotiate a catastrophic deal with Iran to allow that terrorist regime to be a nuclear power. It’s quite another to slant power in the Middle East toward Iranian dominance, as Obama’s senior adviser Ben Rhodes has revealed was the president’s intent from the beginning.But perhaps the greatest stain on the Obama legacy will be the Syrian slaughter and how our president watched hundreds of thousands of innocent Arabs die, including untold numbers of children, and did absolutely nothing.Stupid stuff indeed.The author, whom The Washington Post calls “the most famous rabbi in America” is executive director of The World Values Network, which promotes universal values in politics and culture, and is the international best-selling author of 30 books, including his forthcoming, The Israel Warriors Handbook. Follow him on Twitter @RabbiShmuley.