I'm so sorry you're in this situation, both with his health and the kids' behavior.
I don't think that kids being ungrateful necessarily implies that this is all on him, or on you. Maybe he wasn't a good husband or role model the first time around, with all the drinking, I don't know. Maybe they don't like you - but that shouldn't stop them from having a relationship with their father or calling him on Father's Day.
If she's getting married next month, she has already made her plans. She's not counting on the money. If she has no conversation/relationship with her father, I see no reason why he needs to pay anything - aside from the fact that she is 39 and pays her own way. Your husband couldn't buy her attention with $1000 at Christmas, he can't buy it now. I know he is probably vacillating between doing the "dad thing" to pay for the wedding, and maybe he wants to part on a good note with her having a positive memory of his participation.
I think he needs to get his affairs in order, and that means making sure you are as well situated as possible after he passes. If there's a very limited relationship, I would think it would be very uncomfortable for the daughter to accept a lot of money from her father. She may well have plans to walk down the aisle alone, not escorted by anyone. Maybe she knows her father is terminally ill and wants to invite him to attend, but not put pressure on him. Maybe she doesn't want to give him a position of "honor". I don't know. But you both got an invitation, so I'd accept that as her level of comfort, and I wouldn't push it.
Personally, I would go to the wedding (assuming you both are able) and I would consider 2 gifts - something from their registry, and some family heirloom or keepsake that will let her know she's always been in her father's heart. It should be from HIS side of the family and it should look like he chose it, not you. Perhaps he has a photo of her when she was little, perhaps something from his parents (maybe she could wear a piece of jewelry from his mother as her "something old", or just have it as a keepsake), maybe it could be some recipes from his parents/grandparents. Anything. Even a letter saying what he admires about her and containing his wishes for her future.
I think you should stay out of the exchange with her, just work on encouraging your husband to NOT give up vital funds. If his illness is affecting his thought processes, I'd consider moving most of the money into another account.
I hope this is a good day for the family with some healing and good memories.