The White House has apologized to the British government after alleging that a UK intelligence agency spied on President Donald Trump at the behest of former President Barack Obama.