What was that cause for which they gave the last full measure of devotion? Do you think all of the soliders who died fighting for the same cause?
If you are referring to Abraham Lincoln's words in The Gettysburg Address, it's important to remember why he gave the speech to understand the words "they gave the last full measure of devotion."
The purpose of Lincoln's brief but memorable speech was two-fold: to dedicate a cemetery for Union soldiers killed in the battles of the Civil War, but also to remind the country that the work of reunifying the United States was the ultimate goal. In Lincoln's mind, the Union soldiers who gave their lives ("the last full measure of devotion") were trying to restore what the founding fathers had created with the American Revolution: a united country of states, a democratic republic that replaced British colonies.
It is impossible to know what was in the minds of all Civil War soldiers, but at least nominally, by choosing a side, soldiers were either fighting for the reunification of the country or for the continuation of the secession of the Confederate states.