The ruling means that Le Pen, long been seen as a leading contender to succeed President Emmanuel Macron, will be excluded from the race when his term ends in 2027.