Pillars were also used in idolatry, so it was likewise prohibited to erect a pillar for the purpose of worship, neither in the Temple nor elsewhere. This is true even if the object of worship is God Himself. The Rambam defines the pillar as being made of dirt or stone and the idolators would gather around it. This mitzvah does not preclude erecting an altar when appropriate, even though an altar was made of uncut stones. We see this is true since it was specifically commanded to make an altar after crossing into Israel, as seen in Deuteronomy 27:2-5.
This mitzvah applies in all times and places. It is discussed in the Talmud in tractate Avodah Zarah on page 45b. It is codified in the Mishneh Torah in the sixth chapter of Hilchos Avodas Kochavim. This mitzvah is #11 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos and #162 of the 194 negative mitzvos that can be observed today as listed in the Chofetz Chaim’s Sefer HaMitzvos HaKatzar.