There are many verbal connections between 1 Corinthians 11 and 14. The ‘decently and in order’ text is a close link. The word for ‘decently’ (euvschmo,nwj) is rare (3x) and includes the idea of ‘behaving yourself’. Paul uses the word in Rom 13:13, “Let us behave properly as in the day, not in carousing and drunkenness” (NASB).
The contrast between behaving properly and drunkenness gives us our connection with 1 Corinthians 11 since Paul tells them “for in your eating each one takes his own supper first; and one is hungry and another is drunk.” (v. 21). What we have in 1 Cor 14:40 is a recap and reminder of the problem Paul addressed in 1 Corinthians 11—they were to behave properly at the Lord’s Supper.
The reason why Paul concludes 1 Corinthians 14 in this way is simply that the Lord’s Supper and how they meet together has been his focus across 1 Corinthians 10-14.
The second link with 1 Corinthians 11 is the ‘order’ word (ta,xij). It occurs nine times in the NT in relation to the order of priesthood (Hebrews and Melchizedek, 6x). A cognate verb (diata,ssw) occurs in 1 Cor 11:34 and the connection is brought out in the KJV, “And the rest will I set in order when I come.”
A more modern version might have something like ‘give directions’ (RSV). Paul is saying that he has been setting things in order in 1 Corinthians 11 but there are other matters he will deal with when he visits them. It is the order of things in 1 Corinthians 11 which Paul recapitulates in 1 Cor 14:40 when he says, “Let all things be done decently and in order.”
The reason is the same: Paul has been dealing with the Lord’s Supper across these chapters.