You wanted your son to see this. That's why you did it to boast about your career and how prominent you were.
The above is grammatical. Its 1st objective is to have your son see this; its 2nd, to boast about your career and how prominent you were. That's why suggests that the 1st objective is the main one. This example has a slight different meaning from that below.
You did it to boast about your career and how prominent you were, [sic] and to have your son see this.
The comma should not be there. It cannot be any of the four comma types, the listing comma, the joining comma, the gapping comma, or the bracketing comma. I think it was placed there to indicate a pause.
This example also has two objectives:
. to boast about your career and how prominent you were
. to have your son see this
There is no indication that the 2nd objective is the main one.