This is from chapter 11 of Across the Plains, memoirs of Robert Louis Stevenson's travels from New York to California.
...And we look and behold [humankind] instead filled with
imperfect virtues: infinitely childish, often admirably valiant,
often touchingly kind; sitting down, amidst his momentary life, to
debate of right and wrong and the attributes of the deity; rising
up to do battle for an egg or die for an idea; singling out his
friends and his mate with cordial affection; bringing forth in
pain, rearing with long‐suffering solicitude, his young. To touch
the heart of his mystery, we find, in him one thought, strange to
the point of lunacy: the thought of duty; the thought of something
owing to himself, to his neighbour, to his God: an ideal of
decency, to which he would rise if it were possible; a limit of
shame, below which, if it be possible, he will not stoop.
...[However,] I shall be reminded what a tragedy of misconception and
misconduct man at large presents: of organised injustice, cowardly
violence and treacherous crime; and of the damning imperfections of
the best. They cannot be too darkly drawn. Man is indeed marked
for failure in his efforts to do right. But where the best
consistently miscarry, how tenfold more remarkable that all should
continue to strive; and surely we should find it both touching and
inspiriting, that in a field from which success is banished, our
race should not cease to labour.
...