The pattern of God is to first create, but then to test that creation to determine it's worthiness to retain the privilege to which the creature was called. Having and holding are two different things, as 12 Apostles were granted an apostleship, yet only 11 were found worthy of retaining their office by the final analysis. Adam had an exceedingly high and divine calling, so very high that this lofty privilege demanded a test as to his worthiness to retain it, which test he quickly failed in. We are likewise given an exceedingly great "high calling of God in Christ Jesus", but the hour of trial and temptation will manifest our worthiness or unworthiness to continue in the blessings of that calling. When a gas steel cylinder is first made, it is then brought up to a terrific air pressure to see, (basically,) if it blows up! If it passes the test, then it is stamped in approval for public or private use and would not be deemed worthy otherwise. A well made cylinder with yet undetermined integrity will pass the test, but it still must pass the test. If Jesus Christ is truly and mystically indwelling us, then our inner integrity will finally stand up to all that the world, the flesh, and the devil can throw at us, in spite of some failings along the way. Still, as a yet untested receptacle, we don't really know this experimentally speaking until we actually are called upon to pass through the "fire and the flood".
God allowed this Edenic test of worthiness in Adam and Eve for the same reasons in them, (but not the same state and circumstances,) as in us, and it is only proper for Him to do so. It is His eternal heaven that is being graciously opened for future occupancy, (and not ours by nature,) and He is well within His right to test the worthiness of any applicants, but by so doing, He will have shown them the quality of their nature, which quality He already omnisciently knows, but they are yet to fully appreciate. The test of Adam and Eve in Eden was allowed for by God, partially because they would not have been fully illumined as to the integrity of the management of their own beings had they never been tested. If a cylinder blows to pieces while under pressure, it is then a great mercy as no one will ever be killed by using it. Grind up the fragments, melt them down, recast the steel, retest the cylinder, and use it for it's intended purposes, but it was much different with Adam. Had Adam passed the test, then he would have been advantaged by possessing the full knowledge of his worthiness and integrity. However, when Adam failed the test, he was still advantaged in that now he was a candidate for God's saving grace, which saving grace is far, far more of a display of the glorious power and grace of God, than he would have ever known otherwise. God's saving grace would have never been known by him or by us, had he never been tested and failed in that test. We, (no doubt,) would have never so done had we been the creators, and that's why He is the Creator and no one else.