Naming an alleged Chinese spy who has been linked to Prince Andrew is a matter for the courts, a government minster has said.