The history of the proper locations for offering sacrifices under the Old Testament is like this.
First before Moses sacrifices could be made anywhere. Then once the tabernacle was built, Moses received the command of the Lord that sacrifices could only be brought to the “entrance of the tent of meeting” per Lev 17:
2 “Speak to Aaron and his sons and to all the people of Israel and say to them, This is the thing that the LORD has commanded. 3 If any one of the house of Israel kills an ox or a lamb or a goat in the camp, or kills it outside the camp, 4 and does not bring it to the entrance of the tent of meeting to offer it as a gift to the LORD in front of the tabernacle of the LORD, bloodguilt shall be imputed to that man. He has shed blood, and that man shall be cut off from among his people. (Lev 17:2-4)
The idea is that making your own sacrifice wherever you wanted after the Lord had provided the proper practice within the tabernacle was as bad a shedding blood of a human and therefore punished as severely. However this law did not seem practical when Israel was about to enter Canaan and be always on the move, therefore this restriction was was temporarily repealed by Moses with an eye to a more permanent re-establishment of it in the temple:
First the plan is to establish the rule in the temple:
5 But you shall seek the place that the LORD your God will choose out of all your tribes to put his name and make his habitation there. There you shall go, 6 and there you shall bring your burnt offerings and your sacrifices, your tithes and the contribution that you present, your vow offerings, your freewill offerings, and the firstborn of your herd and of your flock. (Deut. 12:5-7, ESV)
Then as this is not yet practical, the concession is granted:
15 “However, you may slaughter and eat meat within any of your towns, as much as you desire, according to the blessing of the LORD your God that he has given you. The unclean and the clean may eat of it, as of the gazelle and as of the deer.
(Deut. 12:15, ESV).
Finally, as this interim period was come to an end and the Temple was about to be ready to replace the tabernacle, the original Lev 17 ordinance was again resumed. As about just this time, for example, we find the reason why people still sacrificed as ‘high places’:
2 The people were sacrificing at the high places, however, because no house had yet been built for the name of the LORD. (1 Kings 3:2, ESV)
The ‘high places’ although referred to above as simply meaning a place where people sacrificed offering to God, quickly became an offensive term as not only would sacrificing animals there no longer be tolerated as the Temple after the Temple was built, but this was the place where idolatry was also practices to Baal and Ashera idols. Pagans worship their gods there and just like the golden-calf where Israel mixed up the religion of Jehovah with pagan idolatry, so these ‘high places’ became symbols of the same. When Jews worship there is was a corruption and mixture of God and idols. We see a king doing what ‘is wrong’ as leaving those ‘high places’ in tact.
43 He walked in all the way of Asa his father. He did not turn aside from it, doing what was right in the sight of the LORD. Yet the high places were not taken away, and the people still sacrificed and made offerings on the high places. (1 Kings 22:43, ESV)
When a King did ‘what is right’ he removed the ‘high places’. In fact this became a litmus-test phrase to distinguish good kings from bad ones.
19 And Josiah removed all the shrines also of the high places that were in the cities of Samaria, which kings of Israel had made, provoking the LORD to anger. He did to them according to all that he had done at Bethel. 20 And he sacrificed all the priests of the high places who were there, on the altars, and burned human bones on them. Then he returned to Jerusalem. (2 Kings Chapter 23:19-20, ESV)