It depends on your relationship with the decedent’s family – if your presence would upset your wife’s ex-husband’s family in any way, then you should not go. If you have a cordial relationship, then attending would be fine.
The rule of thumb to remember is that the funeral is about the deceased and that person’s family. Attendees are there to support the grieving family, not to be noticed or cause ill feelings. Your wife, I assume, is planning to attend so I am guessing there are no concerns with her attendance. The two of you should make this decision together, with respect to how the decedent’s family would react.