Did all soldiers in the Civil War sleep in tents?

No. Many units started out with tents, frequently big ones that could sleep eight men or so. But these had to be hauled in wagons when the unit moved, and after 1862 the wagons were seldom seen, and neither were the tents, plates, pots and pans they carried. Northern soldiers were issued the two man tents, since known as "pup tents", but they soon tired of carrying them too. Most soldiers wound up with a "blanket roll" - one or two blankets, plus a blanket-sized oilcloth. You'd put the oil cloth next to the ground, a blanket on top of that (if you had two), and cover up with the other blanket. Often men slept with one another to share blankets - there was nothing sexual about it. In the morning you'd stack all the blankets together and roll them up, then fold the roll over in the middle and tie the ends together with a piece of string, and drape them over one shoulder, and you were ready to go. During the winter active campaigning usually ceased, and the armies would "go into winter quarters", and the men would maybe see tents again, or build log huts. Sometimes they'd go up about three feet with logs and put a tent on top of that, so they could stand up inside. It was a very, very rugged life, and many men got sick and died. On both sides, two men died for every one the enemy killed.