Prince Andrew's former senior adviser made a "mystifying" and "very bad decision" when he provided a legal statement for the case of an alleged Chinese spy, without taking any legal advice.