Negative commandment · Lo Ta’aseh #161 of 613
For a High Priest not to marry a widow
שלא ייקח כוהן גדול אלמנה
The verse · Vayikra 21:14
אַלְמָנָה וּגְרוּשָׁה וַחֲלָלָה זֹנָה אֶת־אֵלֶּה לֹא יִקָּח כִּי אִם־בְּתוּלָה מֵעַמָּיו יִקַּח אִשָּׁה
“A widow, or a divorced woman, or a profaned, or a harlot, these shall he not take: but he shall take a virgin of his own people to wife.”
The Rambam’s words
For a High Priest not to marry a widow, as [Leviticus 21:14] states: "A widow, a divorcee, a chalalah, or an immoral woman - these he must not marry."
שלא ייקח כוהן גדול אלמנה, שנאמר "אלמנה וגרושה וחללה זונה, את אלה לא ייקח" (ויקרא כא,יד).
Why · Sefer HaChinuch #273
That a high priest not marry a widow
“It is from the roots of the commandment [that it is] because there are foreign (external) thoughts in marriage to a widow. [It is] similar to that which they, may their memory be blessed, said (Pesachim 112a), “[When] a young man marries a widow, there are three dispositions in the bed, etc.””
Where in the Mishneh Torah
Hilchot Forbidden Intercourse הלכות איסורי ביאה