Ecclesiastes 9:2
1 So I reflected on all this, attempting to clear it all up. I concluded that the righteous and the wise, as well as their works, are in the hand of God; whether a person will be loved or hated—no one knows what lies ahead. 2 Everyone shares the same fate—the righteous and the wicked, the good and the bad, the ceremonially clean and unclean, those who offer sacrifices and those who do not. What happens to the good person, also happens to the sinner; what happens to those who make vows, also happens to those who are afraid to make vows. 3 This is the unfortunate fact about everything that happens on earth: The same fate awaits everyone. In addition to this, the hearts of all people are full of evil, and there is folly in their hearts during their lives—then they die.
Matthew 5:45
43 “You have heard that it was said, ‘Love your neighbor’ and ‘hate your enemy.’ 44 But I say to you, love your enemy and pray for those who persecute you, 45 so that you may be like your Father in heaven, since he causes the sun to rise on the evil and the good, and sends rain on the righteous and the unrighteous. 46 For if you love those who love you, what reward do you have? Even the tax collectors do the same, don’t they? 47 And if you only greet your brothers, what more do you do? Even the Gentiles do the same, don’t they? 48 So then, be perfect, as your heavenly Father is perfect.
Notes and References
"... On the other hand, as Jürgen Becker has noted, hearers would also have heard in this verse echoes of the Wisdom tradition, perhaps especially of Ecclesiastes 9:2, which observes that ‘the same fate comes to all, to the righteous and the wicked, to the good and the evil, to the clean and the unclean, to those who sacrifice and those who do not sacrifice’. Here too there is a clash of expectations – unlike the Wisdom tradition, which saw in this even-handedness evidence of the absence or indifference of God, in the Sermon on the Mount there is neither a resigned skepticism nor an elaborated theodicy. The fact that God rains down on all alike is taken not as an indication of the hiddenness of God, but rather as a revelation of God’s perfection, and as a summons to action. God’s indiscriminate generosity, notes Becker, gives to all without exception the basic conditions of life ..."
Herdt, Jennifer A. Rain on the Just and the Unjust: The Challenge of Indiscriminate Divine Love (pp. 34-47) Studies in Christian Ethics 22.1, 2009