The president responded after a U.S. appeals court dealt him an unfavorable ruling on his executive order.