The cleanest way out is to separate them. The work of art stands on its own, and you can't critique The Epic of Gilgamesh by complaining that they still had slaves back then and there was no health care system.
I haven't read Pushkin, not being into poetry OR speaking Russian, but if Pushkin said some evil things in "To the Slanderers of Russia", you just have to concentrate on the poetry he wrote that does speak to you. Apparently that's difficult but passing moral judgment is easy?