The civil war union want to preserve the union or destroy the confederacy?

Both. The Union wanted to preserve the country as a whole; they did not want the United States to split up. The Confederacy, however, wanted to separate from the United States, therefore, splitting up the country. So the Union wanted to destroy the confederacy to preserve the United States.