did he not lose the popular vote in both occasion
The argument that Trump's Presidency was somehow illegitimate because he lost the popular vote is nothing more than a red herring.
If the popular vote had been the deciding factor, both Trump and Clinton would have organized their campaigns in a totally different manner. Neither of them sought to win the popular vote, it would have been pointless to do so because that's not how one becomes President. They both attempted to win under the existing rules of the game, and Trump succeeded.