What did the Confederate States of America strive to gain from the war? Was it simply separation from the USA, maybe with some extra territory, or did they want to impose their views on the entire country?
The Constitution of the United States, in its fourth Article, provides as follows: "No person held to service or labor in one State, under the laws thereof, escaping into another, shall, in consequence of any law or regulation therein, be discharged from such service or labor, but shall be delivered up, on claim of the party to whom such service or labor may be due."
This stipulation was so material to the compact, that without it that compact would not have been made. The greater number of the contracting parties held slaves, and they had previously evinced their estimate of the value of such a stipulation by making it a condition in the Ordinance for the government of the territory ceded by Virginia, which now composes the States north of the Ohio River.
The goal of the Confederacy was to perpetuate the practice of slavery. While individuals within the Confederacy would aspire to such things as the conquest of the Western territories or Central America and the spread of slavery to new territories, and there was continual debate regarding the nature and limitations of government, the immediate and abiding goal of the Confederacy was the perpetuation of slavery. This was made abundantly clear at the time by the representatives of the traitorous states. For example, Mississippi in its Declaration specified:
Our position is thoroughly identified with the institution of slavery--the greatest material interest of the world. Its labor supplies the product which constitutes by far the largest and most important portions of the commerce of the earth. These products are peculiar to the climate verging on the tropical regions, and by an imperious law of nature, none but the black race can bear exposure to the tropical sun. These products have become necessities of the world, and a blow at slavery is a blow at commerce and civilization. That blow has been long aimed at the isntution, and was tat the point of reaching its consummation. There was no choice left us but submission to the mandates of abolition, or a dissolution of the Union, whose principles had been subverted to work out our ruin.
That's not buried in the text, that the second paragraph. The secessionists made no bones about the fact that slavery was the abiding cause of withdrawal from the United States, and the Confederate Constitution directly addresses the issue of slavery at several points, notably Article I Section 9(4):
No bill of attainder, ex post facto law, or law denying or impairing the right of property in negro slaves shall be passed.
And Article IV Section 3(3):
The Confederate States may acquire new territory; and Congress shall have power to legislate and provide governments for the inhabitants of all territory belonging to the Confederate States, lying without the limits of the several states; and may permit them, at such times, and in such manner as it may by law provide, to form states to be admitted into the Confederacy. In all such territory, the institution of negro slavery as it now exists in the Confederate States, shall be recognized and protected by Congress, and by the territorial government: and the inhabitants of the several Confederate States and Territories, shall have the right to take to such territory any slaves lawfully held by them in any of the states or territories of the Confederate states.
To secure the perpetuation of slavery, the Confederate states rebelled against the lawful government of the United States, seeking to establish and secure their territory under a separate government. Their moves against the federal government included seizing federal forts and arsenals, such as Fort Sumter - this act of armed rebellion is what precipitated the American Civil War.