This was an election that the BJP was destined to lose, given the damage done to the party by the exit of BS Yeddyurappa. But, it appears, the party actually made some good last-minute changes to prev ent a complete disaster. The fact that it has disproved Yeddyurappa's theory that without him the BJP will amount to nothing is actually a plus. It will show doubters within the BJP that the party counts.
Even though public opinion in general backs the BJP's decision to force Yeddyurappa to resign, it is entirely possible that the party leadership will calculate - after toting up the gains and losses - that it would have been better off sticking with him. In the end, it's all about winning and losing. In politics, principles and propriety don't amount to anything more than a hill of beans.