The genealogy back to Adam in St Luke 3.23-38 reflects the theme of universality in St Luke’s Gospel. St Matthew presents the genealogy of Jesus as Israelite, Jewish, Davidic, and royal; so it is traced back to Abraham, through David and Solomon. St Matthew shows great interest in the Kingship of Jesus.
As do all the Evangelists. But they do it in different ways. Both St Matthew & St Luke emphasise the Kingship of Jesus by using Psalm 72. It speaks of the kingdom of the king who is a son of David; of iits universal extent, and of its unending rule. St Matthew latches onto verses 8-11:
8 May he also rule from sea to sea
And from the River to the ends of the earth.
9 Let the nomads of the desert bow before him,
And his enemies lick the dust.
10 Let the kings of Tarshish and of the islands bring presents;
The kings of Sheba and Seba offer gifts.
11 And let all kings bow down before him,
All nations serve him.
When the Magi bring gifts to the Infant Jesus, in St Matthew 2, they are paying Him tribute, paying homage to Him as their Ruler, and recognising Him as the Davidic King of Psalm 72. They are doing what Herod ought to be doing, and does not do. All the words in St Matthew that are translated “worshipped”, can also be translated as “paid homage to”. The verb proskuneō includes both meanings.
St Luke draws on a different part of the same Psalm:
12 For he will deliver the needy when he cries for help,
The afflicted also, and him who has no helper.
13 He will have compassion on the poor and needy,
And the lives of the needy he will save.
14 He will rescue their life from oppression and violence,
And their blood will be precious in his sight;
Verses 12-14 say very much what Jesus applies to Himself in St Luke 4.16 following, when He quotes Isaiah 61. Psalm 72, and St Luke’s use of it, make clear that what Jesus does, He does as Universal King. How far He is prepared to go in “hav[ing] compassion on the poor and needy”, is shown at its starkest when He promises Paradise to the Good Thief crucified with Him. The Universal King of St Matthew is no less truly Universal in St Luke - the two writers make related points, about the same Christ, in slightly different ways,
His Universality as King justifies tracing His genealogy back to Adam. His being the Davidic King, justifies tracing His genealogy back through Solomon, David, & Abraham. The two Evangelists are highlighting different aspects of the “Good News of the Kingship/Reign/Kingdom of God” which is made present on Earth in Jesus, God’s Chosen Anointed King & Son.
Whether Adam was a real historical person, is not relevant to the theological message of St Luke’s genealogy, The Universality of the Kingship of Christ depends, not on the historicality of Adam, or of Abraham, but upon the Purpose of God in sending His Son.