Yes, the way Copilot was trained was morally questionable, but probably legaly fine (Github terms of service).
There is no doubt the result is extremely helpful though.