As the country spiraled towards Civil War, Wallis gave speeches proclaiming the need to keep the Union intact; he found no issue with the institution of slavery. After the Pratt Street Riots, Wallis was one of the men who met with Abraham Lincoln to convince the President not to allow federal troops to pass through Baltimore again. It was during this chaotic time that Wallis was elected to the state legislature in Maryland. Shortly after, the Union Army arrested several Maryland officials, including Wallis, who was imprisoned first at Fort McHenry before eventual transfer to Fort Warren in Boston. He was finally released in November 1862 — a year and two months after his arrest. He wrote his poem "In Fort Warren" when other prisoners (including Confederate officers) were released:
The anchors are weighed, and the gates of your prison
Fall wide, as your ship gives her prow to the foam,
And a few hurried hours shall return you, exulting,
Where the flag you have fought for floats over your home.
God send that not long may its folds be uplifted
O'er fields dark and sad with the trail of the fight;
God give it the triumph He always hath given,
Or sooner or later, to Valor and Right!
But if Peace may not yet wreathe your brows with her olive,
And new victims are still round her altar to bleed,
God shield you amid the red bolts of the battle,
God give you stout hearts for high thought and brave deed!
No need we should bid you go strike for your freedom—
Ye have stricken, like men, for its blessings, before;
And your homes and your loved ones, your wrongs and your manhood,
Will nerve you to fight the good fight, o'er and o'er!
But will ye not think, as ye wave your glad banners,
How the flag of Old Maryland, trodden in shame,
Lies, sullied and torn, in the dust of her highways,
And will ye not strike a fresh blow in her name?
Her mothers have sent their first-born to be with you,
Wherever with blood there are fields to be won;
Her daughters have wept for you, clad you, and nursed you,
Their hopes, and their vows, and their smiles, are your own!
Let her cause be your cause, and whenever the war-cry
Bids you rush to the field, oh! remember her too;
And when Freedom and Peace shall be blended in Glory,
Oh! count it your shame, if she be not with you!
And if, in the hour when pride, honor, and duty
Shall stir every throb in the hearts of brave men,
The wrongs of the helpless can quicken such pulses,
Let the captives at Warren give flame to them then!