Lowell was related to Colonel Shaw through the marriage of Shaw's sister, Josephine, to one of Lowell's ancestors. Ah, so that explains his interest. (Source.)
Charles Russell Lowell, one of Lowell's ancestors, fought and died in the Civil War, too. No wonder he's such a history buff.
The poem was originally titled, "Colonel Shaw and the Massachusetts 54th." Yeah, we can see why that one didn't stick.
Lowell was sentenced to a year in prison for refusing the draft in 1943. Bet you didn't see that coming. (Source.)