The sons of God saw the daughters of men that they were fair; and they took them wives of all which they chose.
This passage, like all of scripture, must be interpretted in the light of 2 Timothy 3:16,17
All Scripture is given by inspiration of God and is profitable for doctrine, for reproof, for correction, for instruction in righteousness: that the man of God may be perfect, throughly furnished (or equipped) unto all good works.
It would be absolutely no spiritual use to us today to learn that angels came down to earth and people had children by them. What would be the spiritual application of that? If you see an angel walking down your street then don't seek any carnal knowledge with them? It would be absurd. And the interpretation is consequently likewise absurd.
But if "the sons of God" simply means "believers" then the passage makes sense. It means that before the flood those who professed faith in the promised Saviour stopped choosing who to marry on the basis of whether their potential wife was godly and started simply choosing on the basis of their appearance/beauty and non-godly criteria.
Before the flood there had been a true church:
At that time men began to call upon the name of the LORD, (Genesis 4:26).
That is, there were true believers.
So, Genesis 6:2 explains how a great falling away from God came about, how a great apostacyapostasy from God came about in the professing church, and why there was a great flood, and why there was only the family of Noah to be delivered at the time of the flood when previously there had been many believers and a professing church. It is warning us of the dangers of marrying an unbeliever.
And the application is fully declared in 2 Corinthians 6:14-18 starting
Be ye not unequally yoked together with unbelievers: for what fellowship has righteousness with unrighteousness? and what communion has light with darkness?
The children of an unequally yoked marriage, if it is chosen when a believer, will commonly be unbelievers, (Malachi 2:15).