#Why would Yahweh prefer that one of the Israelites shut the temple gates to prevent them from lighting fires on his altar in vain?

Because Yahweh's name was going to be glorified among the nations, and in every place the nations were going to offer pure offerings unlike the offerings from the hands of the Israelites. [1:10-11]