Why would God allow man to test Him? Gideon was faithful enough among all the Israelites, to find grace in God's eyes. Presumably, he thought that God had forsaken them so he had to test the Lord's angel to be sure he was sent from Him.


  "And he said unto him, If now I have found grace in thy sight, then
  shew me a sign that thou talkest with me." (Judges 6:17).


Becoming certain of the angel's mission should have been enough to have complete faith and trust in God, availing himself for whatever purpose God had for him. As if he was satisfied, 


  "And when Gideon perceived that he was an angel of the LORD, Gideon
  said, Alas, O Lord GOD! for because I have seen an angel of the LORD
  face to face." (Judges 6:22).


The Lord then begins to talk with him directly after the angel had gone.
But then, he tests the Lord again. 


  "And Gideon said unto God, If thou wilt save Israel by mine hand, as
  thou hast said, Behold, I will put a fleece of wool in the floor; and
  if the dew be on the fleece only, and it be dry upon all the earth
  beside, then shall I know that thou wilt save Israel by mine hand, as
  thou hast said." (Judges 6:36-37).


God responds to him proving that He will act upon His word. Gideon goes on further again asking for another sign.


  "And Gideon said unto God, Let not thine anger be hot against me, and
  I will speak but this once: let me prove, I pray thee, but this once
  with the fleece; let it now be dry only upon the fleece, and upon all
  the ground let there be dew. And God did so that night: for it was dry
  upon the fleece only, and there was dew on all the ground." (Judges
  6:39-40).


In fact, from the last verse I notice that Gideon knew he wasn't supposed to test God. He knew that according to law,


  "Do not put the LORD your God to the test as you did at Massah."
  Deuteronomy 6:16


Why would God allow Himself to go through series of tests? Was the 2nd and 3rd tests necessary?
There are two ways to look at this. The first is that Gideon is testing God. The second is that Gideon is reluctant and doubting, but ultimately willing to accept.

From my understanding, 'testing God' is when a person makes a demand of God just to see if he will fulfill it, not so much to get assurance that God really means for the person to do what it seems like he does. This is treating God like a genie or essentially, controlling God for your own pleasure. Not only does this not benefit God or fulfill his will, it also does not benefit the person, encouraging them to be manipulative and self-willed instead of obedient and courageous.

Since God knows the heart, he can kind of cheat on this - he may let one person seemingly test him a hundred times, but another person he rejects even a single test. But this is because he knows the disposition and the intent which may be hidden from the observer and even potentially the person themselves. Therefore, it may be that Gideon's original motivation was not so good, but God knew he'd come around.

Note, this does not contradict the notion that 'God is not a respecter of persons' - that refers to God treating people differently based on their rank or situation in life. It is clear many times that God treats people differently based on the disposition of their heart. The Psalmist says, 'To the pure I will be pure, to the deceiving I will be deceptive.'