It might've been legal(i doubt it) to spy on foreign person on foreign soil inside (another) foreign embassy according to US law... but that doesn't matter at all when it comes to both Ecuadorean law and UK law.
USA is not a world police, nor is ultimate force of good that all good counters bow to.