The decision was made following investigation into claims of racist and other discriminatory conduct displayed by the team's supporters during Hungary's group stage matches against Portugal, France and Germany.
"The CEDB [UEFA Control Ethics and Disciplinary Body] has decided ... to order the Hungarian Football Federation to play its next three (3) UEFA competition matches as host association behind closed doors, the third of which being suspended for a probationary period of two (2) years as from the date of the decision, for the discriminatory behaviour of its supporters," the UEFA said in a statement.
The Hungarian Football Federation has also been fined 100,000 euro ($119,000) and ordered to display a banner promoting equality during future games.
The incidents in question happened in June. During Hungary's Euro 2020 opener against Portugal, the team's fans displayed homophobic banners. Before the France match, the fans reportedly carried racist banners, while several of the French players were subject to racist verbal abuse, including monkey calls, from the tribunes. Both games were played at the Puskas Arena in Budapest.
Hungary's supporters also brought an anti-LGBT banner to the game against Germany in Munich after UEFA refused a request from Munich's mayor to light the stadium in rainbow colors in protest of Hungary's anti-LGBT law.