Great question — answering as the UphillTech team:
In most situations you're correct in the fact that it is a pointless thing to do. For example, seeing Thor will return at the end of Thor: Ragnarok may seem pointless because we fans already know he's in Infinity War. However, to some casual fans who enjoyed the character/movie, it is an assurance that there will be another chance to see them again. Another reason is also that some marvel movies may have seemed like one and done with certain characters. When Ant-Man released there was no announcement of a sequel so people were genuinely unsure if he would return.
Full answer by DannyJames: https://movies.stackexchange.com/a/88368 (CC BY-SA 4.0).
Need it done for your business? UphillTech.