I think Fort Sumter set the tone for an appropriate and honorable surrender. After 34 hours of bombardment, no way to run, no hope for reinforcements or victory, Major Robert Anderson surrendered the fort, knowing that continuing to fight would only lead to the death of the men under his command.
Both the Federals and Confederates observed that Anderson did the right and honorable thing and he was celebrated.
All the mass surrender that came later (Fort Donelson, Vicksburg, Port Hudson, Appomattox Courthouse) did all of the following:
1) shot at and got shot by the enemy
2) are unable to escape
3) are unable to continue the fight/or will be uselessly slaughtered if they continue fighting
Only then will raising the white flag be acceptable and honorable. Certainly, nobody wanted to surrender and become a PoW, but when all other avenues have been exhausted, surrendering was considered honorable.
The only surrender that prompted public and military outrage was probably Harpers Ferry in the 1862 Maryland Campaign. The largest Federal surrender of the war, and the vast majority of the garrison had not a chance to fire their guns. These troops received the unfortunate stigma of being the "Harpers Ferry cowards". In the Battle of Champion Hill in May 16, 1863, the 32d Ohio was spurred on to charge the 1st Mississippi Light Artillery with the cry "Go in, Harper's Ferry cowards!"