By about 1500, “close” began to develop its now-common sense of “in proximity in space, time, etc.” In this sense of “close” it is the spaces between things that are “closed up,” reduced to a minimum, making the things as near to each other as possible
The use of “close” as an adjective to describe hot, stifling weather (or the hot stale atmosphere in a house or room) comes from the sense of a house or room completely “closed up,” with no circulation of fresh air. This use dates back to the 16th century (“We had now for several days together close and sultry weather.” 1748).