The Kitáb-i-Aqdas - The Most Holy Book
Index term: foundation of, under Society
n134.
the subject of boys
The word translated here as "boys" has, in this context, in the Arabic original, the implication of paederasty. Shoghi Effendi has interpreted this reference as a prohibition on all homosexual relations.
The Bahá'í teachings on sexual morality centre on marriage and the family as the bedrock of the whole structure of human society and are designed to protect and strengthen that divine institution. Bahá'í law thus restricts permissible sexual intercourse to that between a man and the woman to whom he is married.
In a letter written on behalf of Shoghi Effendi it is stated:

No matter how devoted and fine the love may be between people of the same sex, to let it find expression in sexual acts is wrong. To say that it is ideal is no excuse. Immorality of every sort is really forbidden by Bahá'u'lláh, and homosexual relationships He looks upon as such, besides being against nature. To be afflicted this way is a great burden to a conscientious soul. But through the advice and help of doctors, through a strong and determined effort, and through prayer, a soul can overcome this handicap.

Bahá'u'lláh makes provision for the Universal House of Justice to determine, according to the degree of the offence, penalties for adultery and sodomy (Q&A 49).