What is the meaning of Matthew 5:45?

Matthew 5:45 KJV
That ye may be the children of your Father which is in heaven: for he maketh his sun to rise on the evil and on the good, and sendeth rain on the just and on the unjust.

Matthew 5:45 NKJV
“that you may be sons of your Father in heaven; for He makes His sun rise on the evil and on the good, and sends rain on the just and on the unjust.

Matthew 5:45 MKJV
so that you may become sons of your Father in Heaven. For He makes His sun to rise on [the] evil and on [the] good, and sends rain on the just and on the unjust.

Matthew 5:45 KJV 2000
That you may be the children of your Father who is in heaven: for he makes his sun to rise on the evil and on the good, and sends rain on the just and on the unjust.

Interlinear KJV

That /hopos/ ye may be /ginomai/ the children /huios/ of your /humon/ Father /pater/ which /ho/ is in /en/ heaven: /ouranos/ for /hoti/ he maketh /anatello/ his /autos/ sun /helios/ to rise /anatello/ on /epi/ the evil /poneros/ and /kai/ on the good, /agathos/ and /kai/ sendeth rain /brecho/ on /epi/ the just /dikaios/ and /kai/ on the unjust. /adikos/

Albert Barnes’ Commentary

Verse 45. That ye may be the children of your Father. In Greek, the sons of your Father. The word son has a variety of significations. See Barnes for Mt 1:1. Christians were called the sons or children of God in several of these senses: as his offspring; as adopted; as his disciples; as imitators of him. In this passage, the word is used because, in doing good to enemies, they resemble God. He makes his sun to rise on the evil and good, and sends rain, without distinction, on the just and unjust. So his people should show that they imitate or resemble him, or possess his spirit by doing good in a similar way.

{l} “sun to rise” Job 25:3 

Matthew Poole’s Commentary

Ver. 45. As your heavenly Father hath a common love, which he extendeth to all mankind, in supplying their necessities, with the light and warmth of the sun, and with the rain; as well as a special love and favour, which he exerciseth only toward those that are good, and members of Christ; so ought you to have: though you are not obliged to take your enemies into your bosom, yet you ought to love them in their order. And as your heavenly Father, though he will one day have a satisfaction from sinners, for the wrong done to his majesty, unless they repent; yet, to heap coals of fire on their heads, gives them good things of common providence, that he might not leave them without witness, yea, and affords them the outward means of grace for their souls: so, although you are bound to seek some satisfaction for God’s honour and glory from flagitious sinners, and though you may in an orderly course seek a moderate satisfaction for the wrong done to yourselves, yet you ought to love them with a love consistent with these things; that so you may imitate your heavenly Father, and approve yourselves to be his children.

Adam Clarke’s Commentary

Verse 45.   That ye may be the children of your Father] Instead of uioi children, some MSS., the latter Persic version, and several of the primitive fathers, read omoioi, that ye may be like to, or resemble, your Father who is in heaven.  This is certainly our Lord’s meaning.  As a man’s child is called his, because a partaker of his own nature, so a holy person is said to be a child of God, because he is a partaker of the Divine nature.  

He maketh his sun to rise on the evil] “There is nothing greater than to imitate God in doing good to our enemies.  All the creatures of God pronounce the sentence of condemnation on the revengeful: and this sentence is written by the rays of the sun, and with the drops of rain, and indeed by all the natural good things, the use of which God freely gives to his enemies.”  If God had not loved us while we were his enemies, we could never have become his children: and we shall cease to be such, as soon as we cease to imitate him.