Nature, the ultimate pragmatist, doggedly searches for something that works. But as the cockroach demonstrates, what works best in nature does not always appeal to us.
I think it's a misreading of Dostoevsky to think of him as a programmatic theist. He's actually much closer to someone like William James. He's actually a pragmatist.