Xyella fastidiosa, first spotted in 2013, is not harmful to humans but poses a serious threat to Italy's olive and orange groves and vineyards and there are fears it could spread to other European Union countries such as France or Spain.
The Luxembourg-based European Court of Justice said the Commission "may require member states to remove all plants capable of being infected by the Xylella fastidiosa bacterium, even when there are no symptoms of infection, when such plants are in the vicinity of plants already affected."
"That measure is proportionate to the objective of protecting plant health in the European Union and is justified by the precautionary principle," it said in a statement.
The Commission, the EU's executive arm, has pressed Rome to destroy infected trees and those within 100 metres (yards) in an effort to control the spread of the disease.
The worst affected region is Puglia in southern Italy where it is estimated some 10 percent of its 11 million olive trees could be cut down.
Local prosecutors managed to halt the felling in December, arguing there was no proof of a clear link between the bacteria and the drying out of thousands of olive trees.
The court hearing their submission agreed to a halt but also decided to refer the issue to the ECJ, asking it to rule on whether the Commission, the EU's executive arm, was acting within the law.
"By today's judgement ... the Court confirms the validity of the Commission's decision," the ECJ said.