I was thinking about it tonight, but in all the reading I've done on the American Civil War, espionage is never mentioned. They have the same language, the same culture, you'd be relatively familiar with the other side's dialect, and likely have lots of contacts on the other side. It wasn't uncommon for Southern aristocrats to go to college up north, and many of them were officers of the Confederacy.
Was it ever used?
Spying was incredibly widespread and common for both sides during the Civil War. In practice it was quite varied, ranging from organized networks of spies to individuals simply riding behind enemy lines in disguise and reporting back what they saw. The Confederacy's initial spying efforts were almost entirely focused on Washington and largely organized by the governor of Virginia, John Letcher. Their network was constructed through personal relationships with sympathetic individuals within the capitol, namely a socialite widow named Rose Greenhow. Greenhow rubbed elbows (and possibly slept) with a number of important figures in government. She would convey her information (and the information of any other individuals she brought into her ring) through a ciphered letter via what became known as "secret lines": nebulous networks of contacts that would courier missives across the relatively porous front line. At times, the Confederacy even used sympathetic employees within the USPS to get their missives almost all the way down to Confederate lines before being carried over. As the war progressed, Confederate espionage activities became more organized. Specifically, the Confederate Army signal corps established a Secret Service with the express intent of organizing espionage efforts, running agents and missives across combat lines and ensuring that spies knew what pertinent information they needed to gather. The Confederacy in particular became eager for Open Source intelligence, newspapers, posters, and other publicly spread documents that indicated how Northerners felt the course of the war was going and gave information regarding troop movements or deployments to someone studying them carefully enough. They also, on occasion, tapped telegraph wires, something that the Union was very lax about thinking about.
Indeed, the Union's intelligence efforts were rather different. There was truly no effort on behalf of the Union military or government to create a centralized spy agency or anything like the Confederate Secret Service. Each individual general considered himself responsible for running his own spies if he deemed them necessary, leading to extensive decentralization among Union actors when it came to intelligence collection. Things were so disorganized that at one point in time, according to CIA historians, "President Lincoln himself even hired an agent on his own, paid him, and personally received the agent’s reports," and "the operatives of one “secret service” arrested or kept under surveillance the operatives of the other." The major espionage figures for the Union were three individuals: Allan Pinkerton, Lafayette C. Baker, and Colonel George Sharpe. Pinkerton, the founder of the famous Pinkerton Detective Agency, offered his services and the services of his detectives as both spies and counterintelligence operatives during the war. Initially, he made the offer to Lincoln, but before Lincoln could respond, General McClellan hired him instead. From that point on, Pinkerton came to work solely for McClellan, passing intelligence to just him despite eventually calling himself the Chief of the United States Secret Service. Pinkerton was not actually very good at the job, regularly providing McClellan with ridiculous overestimates of Confederate strength and essentially got his most effective agent, a man named Timothy Webster, killed due to impatient and poor choices in personnel. Baker, an itinerant wanderer and, if accounts are to be believed, generally unpleasant man, claimed the title of head of the National Detective Police and ultimately ended up working for the War Department, performing espionage as well as tracking down deserters. Colonel Sharpe, undoubtedly the most capable of the three, started off working for General Hooker but eventually ended up under General Grant. Sharpe, working closely with a former Pinkerton agent named John Babcock, created an extremely efficient network of scouts and secret agents for Grant that he dubbed the "Bureau of Military Information." The Union spy networks ran much similar to their Confederate counterparts, connecting sympathetic Southerners with individuals stationed in the Union and conducting missives back and forth via complex lines of communication. These usually involved deserters, individuals under cover posing as everything from cobblers to bakers, and individuals with passes to cross the line, maybe in the capacity of a foreign observer or as a traveling merchant. The Union also benefited from intelligence arriving from "contrabands", free or escaped slaves and their contacts. These spies were often more effective than anything Pinkerton could field (though some worked for him) and often used the natural prejudices of the South to their advantage. John Scobell, a freed slave who worked as a Pinkerton agent, once escaped capture while posing as a slave because the individuals interrogating him assumed that a slave was too stupid to be a spy. Even Harriet Tubman participated, utilizing the impressive web of the Underground Railroad to funnel information back to the Union while herself leading what CIA historians dubbed, "a special operations force" under the command of firebrand abolitionist Union officer Colonel James Montgomery. Tubman and handpicked cohorts participated in Union military operations, namely a wildly successful night raid on Confederate positions near Beaufort, South Carolina. Despite this heroism, it's worth noting that what was arguably the Union's biggest intelligence coup of the war came not from any of their multitude of spies, but rather from a pair of infantrymen lounging in a field who discovered a discarded envelope, inside which were, "three cigars wrapped in a copy of General Robert E. Lee’s Special Orders No. 191, perhaps dropped by a galloping Confederate courier." This gave McClellan the complete picture of the Confederate army's plan in the region and was invaluable to the war effort. Doubtless, Pinkerton was very annoyed he couldn't claim credit for that!
As the war progressed, both sides came to rely heavily on behind enemy lines reconnaissance that blurred the line between spy and soldier. According to CIA historians, the distinction was often made brutally simple, "if you were caught in your army’s uniform, you were a prisoner of war; if you were in disguise, you were a spy and could be hanged." These riders would often act individually, but sometimes in patrols, and would simply gallop behind enemy lines observing troops movements and gathering information they thought would be pertinent to the needs of commander in the field. A good example is the semi-famous Henry Thomas Harrison, an actor turned spy who worked for General Longstreet and who accurately provided the information on the Army of the Potomac's movements to Lee that precipitated the Battle of Gettysburg (he gets his own POV chapter in The Killer Angels). Indeed, when both sides collected information from "scouts" it could easily be said that they were collecting information from spies rather than dedicated military personnel. Many generals set up their own "scouting" groups as well in order to field accurate military intelligence above and beyond that being provided by other espionage groups. I would go so far as to say that this type of behavior was the most common form of spying carried out during the war, as it was surely the simplest. A lone man or group of men moving carefully could quite easily slip behind enemy lines and observe extensively, though obviously the perils of getting caught were great.
Sources
The Central Intelligence Agency, Intelligence in the Civil War https://www.cia.gov/library/publications/intelligence-history/civil-war/Intel_in_the_CW1.pdf
James McPherson, Battle Cry of Freedom
Peter Maslowski, Military Intelligence Sources During the American Civil War: A Case Study, in U.S. Army Military Intelligence History: A Sourcebook http://huachuca-www.army.mil/files/History_MIReader.pdf