"To Althea, from Prison" is about prison, about love, about politics, but it's also about poetry. Song and poetry are often linked in literature, which explains why the speaker says he will sing even louder than caged birds, and moreover that he will sing about the glories of his king. The poem implies that poetry—and art more generally—is somehow bound up with the political organization of one's country. For the speaker, the best way to shout his political opinions to the rooftops is through a poem. (Man, we sure wish all the YouTube commenters would take a page out of his book.)
Subtlety alert! The rhyme on "sing" and "king" suggests that singing—and all art—should be about one's "king," one's political leader.
Hardship can be a good thing. It is only be being stuck in prison that the speaker can write the poem and practice his art.