Beginning at verse 17 is Luke's version of the "Sermon on the Mount" Here it is the Sermon on the level place or plain.
The questions about the Sabbath and Jesus continual refusal to play religion with the hyper religious Pharisees is beginning to cause a stir within the religious community. When legalism prevails we no longer see human need and the amazing love of God that is available for everyone. When legalism prevails all we see are winners and losers, insiders and outsiders, or the faithful and sinners.When legalism prevails we denigrate the good deeds of others because they don't fit into our behavioral categories and expectations. Jesus heals on the Sabbath -- not forbidden in the law except for the Pharisaical spin that forbids anything that could possibly be construed as work on the Sabbath.
Before the "Sermon the the Plain" Jesus selects his 12 (see verse 12-16). Like any good Greek culture list the most important person is listed first (Simon Peter).
The Sermon on the Plain has beatitudes like Matthew 5 except that the implied curses are spelled out. As I understand the older traditions a list of blessings always had a corresponding curse list. The curses would be reserved for the opposite position of the blessings. Hence -- blessed are you poor (20) but woe to you who are rich (24); blessed are you who are hungry now (21) but woe to you who are full now; blessed are you when you are hated for my sake (22) but woe to you when they speak well of you.
The rest of the sermon looks a lot like the reader's digest condensed version of Matthew 5-7. Love your enemies -- it is not enough to only do good to those who will reciprocate by doing good to you (27) the key to the kingdom is to adopt the behavior and expectations of the king. This behavior us summarized in verse 36: "Be merciful, just as your Father is merciful." Do not judge; be generous, remember that the point is not just the change of behavior but the transformation of the self. One can change one's behavior and never be transformed -- this is the Pharisee's fundamental problem: they have changed their behavior through legalistic ropes and chains but their hearts are untouched.
Life in the Jesus is a life that is reworked from the inside out. We become good trees and therefore we bear good fruit. We become good people and therefore we bear the fruit of the Holy Spirit in our lives. This is what it means to build on a good foundation. This kind of life can only happen through a deep committed and life altering relationship with Jesus Christ and learning to live life in the community he formed.