We as believers in Allah (SWT) believe that every act or order from Allah (SWT) is according to the best Wisdom and Mercy because He is The Absolute Wise and His Knowledge is the Full Knowledge and His Mercy is the Absolute.
We should not expect our limited minds to be able to contain the un limited Knowledge and Wisdom of Allah (SWT). We say : Allah knows the best. This does not mean that we are prohibited from thinking, on the contrary, we ae always been encouraged to think in the proper way of thinking, which guides us to the truth which includes the reality that our abilities including our thinking powers are limited.
Allah (SWT) guided Adam and Hawwa to be away from a tree for divine wisdom best known to Him. It might be training them for the next step which is to be on earth to establish human life n this planet and it might be other reasons.