Joseph was raised in a God - fearing family, and he understood that sexual relations between people who are not husband and wife are wrong.
تَرَبَّى يُوسُفُ فِي عَائِلَةٍ تَخَافُ ٱللهَ ،‏ وَكَانَ يَعْرِفُ أَنَّ ٱلْعَلَاقَاتِ ٱلْجِنْسِيَّةَ بَيْنَ شَخْصَيْنِ غَيْرِ مُتَزَوِّجَيْنِ إِنَّمَا هِيَ خَاطِئَةٌ .‏