The ephod was an apron-like garment worn by the Kohein Gadol on which the choshen, the breastplate, was placed. The choshen was held in place on the ephod by rings and straps so that it should not be moved from its proper position over the Kohein Gadol’s heart.
The reason for this mitzvah is that everything in the Temple should be just right in order to properly impress upon us the grandeur of the service. If the choshen were not tied in place, it would slide around while he performed his duties, which would be somewhat less majestic than appropriate. (Imagine how distracting it would be if the President were on TV and his tie was over his shoulder.)
This doesn’t mean that the choshen was always attached to the ephod. If that were the case, they would be a single garment. Rather, they were two garments that were attached during the time of service. They were fastened when the Kohein Gadol put them on and detached when he removed them.
The prohibition against separating the choshen from the ephod applied to both men and women while the Temple stood. It is discussed by the Talmud in tractate Yoma (page 72a) and codified in the Mishneh Torah in the ninth chapter of Hilchos Klei HaMikdash. It is #87 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos.