Budapest hosted four games of the tournament, which ends on Sunday when England face Italy in the final at Wembley.
Hungary's 3-0 defeat to Portugal and 1-1 draw against France in Group F each took place at the Puskas Arena in front of packed crowds of over 60,000.
During the Portugal game, images of a banner among the home supporters in the stands reading "ANTI LMBTQ" circulated on social media.
The words refer to the Hungarian language abbreviation for lesbian, gay, bisexual, transgender and queer.
The matter was reported to UEFA by anti-discrimination group FARE.
Before the clash with France, some Hungary fans took part in a pre-match march in Budapest and unveiled a banner opposing the act of kneeling before matches.
The act is a peaceful anti-racism protest in which several teams participated.
Given the latter incident took place outside the stadium, it did not fall under UEFA's jurisdiction.
But European football's governing body said it was investigating possible acts of discrimination inside the Puskas Arena from both matches.
And UEFA confirmed sanctions against the Hungarian Football Federation (MLSZ) on Friday in response to discriminatory acts at those contests and Hungary's 2-2 draw with Germany in Munich.
UEFA's Control Ethics and Disciplinary Body ruled that Hungary should play their next three UEFA competition matches behind closed doors.
The third match is suspended for a probationary period of two years.
The MLSZ has also been ordered to pay a 100,000 euro (118,000 dollars) fine.
It is also to implement a directive to display UEFA's "#EqualGame" banner at UEFA competition matches where it serves as the host association.
Hungary do not play another UEFA competition fixture until the 2022/2023 Nations League, which starts in June next year.
They are back in action in World Cup qualifying when they host England on Sept. 2.
The order to play behind closed doors does not apply to World Cup qualifiers, which fall under FIFA's jurisdiction.
Hungary are second in World Cup qualifying Group I with seven points from three games.