The best explanation for why the capital of South Carolina was moved from Charleston to Columbia is:
Charleston was a target for attacks by several different groups.
This reflects the need to relocate the capital to a more secure and defensible position, reducing the vulnerability of the government and its operations during times of conflict.