The Literal Commandment
'A widow, or a divorced woman, or one who is profaned by harlotry, these he may not take; but rather he is to marry a virgin of his own people, so that he will not profane his offspring among his people; for I am the LORD who sanctifies him.'" (Leviticus 21:15)
The literal commandment is that the high priest (verse 10) should not profane his offspring [literally: seed] among his people. Since that would occur through sexual relations with someone G-d has forbidden to him this prohibition is understood that he cannot have sexual relations (even outside of marriage) with a widow.