✔ 最佳答案
Actually it is completely legal and does not consider as discrimination.
Since the United States is lacking a lot of highly-skilled personnel, there is a program for H1-B for highly skilled labor. This program is a temporary work visa program in order to supplement the vacancy.
Therefore, when those vacancy are no longer needed. They must be first one to go as it is a part of the agreement as a supplementary labor.