Constitutional law is very complicated. I believe they voted as they did because they believed the president DOES have the right to impose such a ban on an "emergency" basis. But his right isn't entirely unfettered, and that's what they'll decide when they consider the merits (or lack thereof) of the case.
I'm sure Trump would like to eliminate the 3rd branch of government since it cost him $25M.