Two writers of Avengers: Endgame - Christopher Markus and Stephen McFeely answered The New York Time about the decision for Captain America to live his life with his love:
“From the first stage, we all know he will dance with Peggy. Ignoring that, I was wondering between giving fans what they wanted or for the character he needed. Because I think it's good for the character, but still give you what you want. Is that good? I do not know. But in my opinion, it is extremely satisfying. He postponed his life to fulfill his duty. That's why we never thought he would let him die. The story could not have been like that, but it had to be a shield because I was done. "
See more: Iron Man I love you 3000 times shirt