Overall, the poem is a declaration of independence that some might interpret as being almost defiant. The speaker is imprisoned, away from the woman he loves because of his loyalty to the King whose enemies have captured him. However, he does not find this a situation to be mourned or regretted.
Instead, he affirms the freedom of his mind and spirit. Because his thoughts can not be taken from him, he is able to remember and imagine the time and pleasures he shared with his lover. Despite the consequences of his loyalty to the King, he remains steadfast in loudly proclaiming "how good He is."
The speaker exults in the freedom of his spirit. Prison is not a punishment; the victory of mind over physical location is celebrated in this poem.