The court ruled that subsidies granted to operators of DTT services between 2005 and 2009 break EC rules, confiring a decision by the Commission in 2013.
The court ruling requires Spain to recover €260 million in subsidies.
The court said that the measures adopted by Spain breached EC rules on technology neutrality. In the absence of a clear definition of what constituted a public service in relation to DTT operators, the measures constituted illegal state aid, it said.
The court decision upholds a ruling by the EC in June that the subsidy scheme favoured DTT at the expense of other technologies, following a complaint by satellite operator SES Astra.
The EC in October separately ruled that subsidiaries totaling €46 million granted in Castilla-LaMancha, where the recipients were preselected, were illegal.