Why do the states have capitals?

State capitals serve as the seat for govenment at the state level. The United States has govenment on a national or federal level, (the president, congress, US Supreme Court judges, etc.) But each of the 50 states has their own leader (called the govenor) as well as congressmen/women and judges at the state level.