Your feelings are understandable–but does God consider you a failure? Listen: If you were a faithful and devoted husband during those 32 years of marriage, then God considers you a success.
Let me expand on this a little bit. I don't know all the details of your marriage's breakdown, of course, but if what you say is true, then your wife was a very self-centered person. When you were married, you both took a vow before God to be faithful to each other "for richer or poorer, in plenty and in want" (or words to that effect). But she chose not to keep that part of the vow; she wanted the "richer" part but not the "poorer." You didn't break your vow; she did.
The most important thing I can say to you, however, is that God loves you, and He knows what has happened to you. Ask Him to help you begin to see yourself through His eyes. You are so valuable to Him that He sent His Son into the world to die for you. If we know Christ, the Bible says, we are "God's chosen people, holy and dearly loved" (Colossians 3:12).
Yes, you are going through a hard time right now–but God wants you to go through it with Him by your side. By faith ask Christ to come into your life. He will give you hope–hope right now, and hope for eternity.