Polygamy was illegal when Mormons were polygamists. Later in the 1890s, they stopped because they wanted to become respectable. It was part of the deal for making Utah a state.
I’m well aware of Mormon history.