Even after Spartans grew up and got married, Spartan men ate all their meals with the other soldiers, instead of with their families. Meanwhile, Messenian (helot) families did stay together, but they all had to work very hard on the farms, and were treated badly by their Spartan masters.
The Spartan army was famous for being the best army in Greece. But to keep the helots enslaved, the Spartans had to keep their army close to home. As soon as the Spartan army was busy somewhere else, the helots would revolt and try to get free.
When the Persians attacked Greece in 490 BC, the Spartans refused to surrender or make any alliance with the Persians. But they did not send any soldiers to fight at Marathon either, because they were in the middle of an important religious festival.
So when the Persians attacked again, in 480 BC, the Spartans wanted to show that they really were a strong army, just as good as the Athenians or better. They sent a lot of soldiers to defend the pass at Thermopylae. Many of them, including their general Leonidas, died there defending Greece. At the battle of Plataea, too, the Spartans showed their skill and courage.
After the Persian wars were over, though, the Spartan army quickly went home, partly because they didn’t like being commanded by Athenian generals, and partly because they needed to keep the helots from revolting.