WASHINGTON—President Trump said Friday that he wants to find ways to allow companies to retain top foreign workers, as he made an argument for shifting toward a merit-based immigration system.

“I get calls from the great tech companies and they are saying we don’t allow people at the top of their class at the best schools in the country, we don’t allow them to stay in our country,” Mr. Trump said during a Rose Garden news conference over the partial government shutdown. “We have to let these great, brilliant companies have...