Equality of opportunity after centuries of slavery and then legal discrimination in a society that allows (and even outright promotes) inherited wealth and opportunity is not possible.
Imagine my ancestors stole all of your ancestors stuff and I still get to keep it all and anything I've built using it. We've stopped stealing your stuff now, though, so we have "equality of opportunity."
We'll have to agree to disagree about the invasiveness. In the case of the lawsuit in the original post, it's the search of all your electronic devices. I consider that to be quite invasive.
Furthermore, CBP and ICE both claimed their authority to search electronic devices at the border extended to US citizens, so much of the profiling was not just of people from certain countries, but from people whose ancestry was from certain countries.
Lastly, I can't and won't try to convince you that it's wrong to subject people of various backgrounds to different, worse treatment, whether it's "cruel and unusual" or unfair, or invasive, or even simply inconvenient. It sounds like you aren't usually subject to such treatment or else you would probably have a different outlook on it. I recommend talking or listening to some people who do, and what their experiences are like.
I don't have a source at the ready, but my understanding is that the existing law and/or case law determined that traveling domestically entitled one to such protection. Various federal agencies have determined via rule making that such protections do not extend to international ports of entry/airports for reasons of national security. Those determinations are what have been struck down in this case.
I'll (possibly inaccurately) assume this is in good faith. The most obvious reason that profiling is bad, even in your inaccurate and simplistic hypothetical scenario, is that just because all airplane terrorist attacks came from people of X country, does not imply that everyone from X country commits terrorist airplane attacks. Therefore you are unfairly and immorally forcing invasive searches on many innocent people of X country. If you have any empathy for the innocent people of X country, you will realize how horrible this is.
I also think it's an attempt to ward off a nascent unionization push.
Regarding a different, recent "olive branch" type proposal:
"The one thing they don’t want to give you is the thing that you need to get. This offer from Uber and Lyft is like a kidnapper offering you a softer blanket, as long as you agree not to ever escape. No thanks. These companies know very well that once their workers become actual employees, they will get a host of benefits automatically, and they can formally unionize to win themselves many more benefits and increased pay. These companies, which have never made a dollar even while exploiting their workers, fear this. So they offer some concessions." [1]
This is the strongest argument that can be made for universal programs when it comes to designing progressive public policy. Rich people have the time and resources to aggresively take advantage of any system that tries to implement means testing or scaled benefits. The winning play is to design programs where benefits are given completely independently of time, money, access or power, even if it means some people who do not need it will get some assistance.
Imagine my ancestors stole all of your ancestors stuff and I still get to keep it all and anything I've built using it. We've stopped stealing your stuff now, though, so we have "equality of opportunity."