Barclay explains that the words translated "and he taught them saying" are in the aorist tense and would be better translated "this is what he used to teach them". In other words, He gave this sermon, or versions of it, on several occasions and Luke's Gospel includes this same teaching but spread through the Gospel and associated with different occasions.
It's interesting, for reasons we shall soon see, to compare Matthew and Luke's beatitudes.
Blessed are the poor in spirit,
for theirs is the kingdom of heaven.
Blessed are those who mourn,
for they will be comforted.
Blessed are the meek,
for they will inherit the earth.
Blessed are those who hunger and thirst for
righteousness, for they will be filled.
Blessed are the merciful,
for they will be shown mercy.
Blessed are the pure in heart,
for they will see God.
Blessed are the peacemakers,
for they will be called sons of God.
Blessed are those who are persecuted because of righteousness,
for theirs is the kingdom of heaven.
Blessed are you when people insult you, persecute you and falsely say all kinds of evil against you because of me.
Rejoice and be glad, because great is your reward in heaven, for in the same way they persecuted the prophets who were before you.
Blessed are you who are poor,
for yours is the kingdom of God.
Blessed are you who hunger now,
for you will be satisfied.
Blessed are you who weep now,
for you will laugh.
Blessed are you when men hate you,
when they exclude you and insult you
and reject your name as evil, because of the Son of Man.
Rejoice in that day and leap for joy, because great is your reward in heaven.
For that is how their fathers treated the prophets.
The first thing we might notice is that Matthew has "blessed are the poor in spirit" while Luke simply has "you who are poor now"; and Matthew has "Blessed are those who hunger and thirst for righteousness" while Luke has "you who hunger now". In other words, it seems that Luke was describing actual poverty and hunger, while Matthew has a kind of spiritual yearning for righteousness. Perhaps this is why Matthew's account is generally more popular - it's easier to address an abstract 'spiritual' problem than to deal with real poverty.
Jesus almost certainly spoke in Aramaic, and the Hebrew and Aramaic words for "poor" carry both meanings: actual poverty, as well as poor 'in spirit'*. We don't have to look far for the reason why. As Stassen and Gushee** put it: "In the Bible, the poor rely more on God. Just spend some time serving the poor in a homeless shelter and talk with people long enough to get to know them. The poor - as a whole - do have less pride that gets in the way and really do trust more in God. ... The poor are blessed not because their virtue is perfect, but because God especially does want to rescue the poor. God knows that people who have power often use that power to guard their own privileges and to seek more power. The poor get pushed aside and dominated."
People who are "poor in spirit" will be able to identify with the needs of those who are materially poor, and have compassion for them. Jesus announced through the Beatitudes, as He did with His quotation from Isaiah 61 in His first sermon, that God is bringing deliverance to the oppressed. That deliverance will ultimately come in the Age to Come, the consummation of the Kingdom of God, but through the grace-based deliverance at the heart of Jesus' ministry we see the inauguration of His kingdom.
As a community Jesus' followers participate in this deliverance by caring for the poor and oppressed.
* See for example Brown Driver and Briggs Lexicon which gives the following meanings of the Hebrew word: poor, oppressed by the rich and powerful, powerless, needy, humble, lowly, pious.
** Glen H. Stassen and David P. Gushee, Kingdom Ethics, Intervarsity Press, 2003, p. 38