And I thought the dead who are already dead more fortunate than the living who are still alive.
Solomon had a large soul (Kg1 4:29) and it appeared by this, among other things, that he had a very tender concern for the miserable part of mankind and took cognizance of the afflictions of the afflicted. He had taken the oppressors to task (Ecc 3:16, Ecc 3:17) and put them in mind of the judgment to come, to be a curb to their insolence...
Commenting on Ecclesiastes 4:1-3
Wherefore I praised the dead, which are already dead,.... Truly and properly so; not in a figurative sense, as dead sinners, men dead in trespasses and sins; nor carnal professors, that have a name to live, and are dead; nor in a civil sense, such as are in calamity and distress, as the Jews in captivity, or in any affliction, which is sometimes called death...
A profane sentiment if severed from its connection; but just in its bearing on Solomon's scope. If religion were not taken into account (Ecc 3:17, Ecc 3:19), to die as soon as possible would be desirable, so as not to suffer or witness "oppressions"; and still more so, not to be born at all (Ecc 7:1).