The European Union’s Court of Justice on Thursday upheld a lower court ruling that corporate tax exemptions Spain extended to seaports were illegal state aid, brushing aside arguments that a more thorough economic analysis was warranted to prove the tax breaks bestowed an unfair advantage.