Nintendo is not a direct competitor. And even if they were, what exactly does Valve have to lose here?
Portal was released on the Switch, so presumably they do have some sort of relationship.
As someone else already pointed out, this was likely done through Nvidia, they had already done an ARM port of Portal for the Shield which is basically the same hardware as the Switch so they probably just asked Valve and they said "sure, why not"