Executives from big technology companies such as Alphabet Inc.’s Google Inc. GOOG, -2.37% , Facebook and Microsoft Corp. MSFT, -1.24% were among those who jumped to criticize Trump’s temporary immigration ban.