My understanding is that the force seeks balance. As Yoda is essentially one with the force now, he can only act within the confines of that balance. The turmoil within Luke regarding the temple/tree was throwing the force out of balance so Yoda acted as the force as a whole and restored balance. He did not utilize his own force powers to summon lightning, he acted as more of a messenger of the force.
While I have a good deal of issues with the movie and with Rian Johnson's handling of logic (which was also an issue in Looper), this isn't really one of them.
Please explain to me how Luke's feelings about the temple effect the balance of the force in any way, shape, or form. He's just an old fart sitting around. Has been apparently for some time. If his conflicting emotions (about anything for that matter) is such an issue for the force (which he also apparently cut himself off from a while ago), why didn't it just send Yoda to smack some sense into him via lightning bolt or whatever right fucking then when it became an issue? Because Luke's whole conflicting emotions, and disappearing act is basically what threw the force all out of whack the second he decided he should sneak into Ben's room and contemplate turning him into swiss cheese for thinking naughty thoughts. The force was plenty content enough with Luke's absence, conflicting emotions, and general lack of caring, when it was just pumping all it's good guy juice into Rey, ignoring literally every other force sensitive person in the whole wide galaxy.
Also, the force sure lets one side (usually the evil one) do a whole lot of curb stomping before it decides it's time to send a message and get back to "balancing" shit.
Luke's feelings about the temple affect the balance of the force because Luke's influence was largely pivotal to the conflict we saw in the movie. If he was unable to move forwards with his character arc and get past his feelings about the force and the past, the resistance may have died in that base. As for why it didn't happen earlier, perhaps there were other avenues of balance that were able to keep things from breaking before that point (evidenced by the fact that the rebellion survived to that point still around). Additionally, we know that Luke had closed himself off from the force. Rey's arrival seemed to have made him conflicted about that decision, allowing the force (aka Yoda) to work its way back in. One interesting tidbit is that Force ghosts require a strong presence of the force to serve as a beacon to allow them to home in on the location or person they are looking for. It is quite possible that Yoda couldn't actually find Luke until Rey showed up.
Also, I think the reason that the Sith are often able to push things away from balance, is because the Jedi seek balance while the Sith do not. Because of that, the view of the Jedi as the "light" and the Sith as the "Dark" is a bit misleading. Balance is a fairly natural state of life and death in harmony. Perhaps it would be more apt to describe the Jedi as "harmony" and the Sith as "entropy". As such, when power shifts to the Jedi, the galaxy finds harmony between light and dark whereas when the Sith find power, the galaxy finds disorder and chaos. Perhaps it could be said that the "dark side" vs "light side" are tools which are used as opposed to states in which the Jedi/Sith exist in. The Sith use the power of the dark side to throw the galaxy out of balance, which the Jedi use the power of the light side to bring the galaxy back into balance.
That said, I am no expert in the Extended Universe (or I guess even Star Wars as a whole).