The ECO is reasonably polite about it, but he thinks you were working illegally during your last visit to the UK, and that you're going to do that again if you get a new visa. It is hard to fault him.
Your story seems to be that when you failed the exam previously, you just happened to have enough money saved up that you could decide to stay in the UK and study for half a year without any income. How did you pay for food and shelter during that period? Apparently you didn't offer any explanation of where all that money came from, so the ECO is entitled to consider it the most likely explanation that you instead worked illegally to support yourself.
Furthermore, even if you did have that kind of money sitting around, it would have been plenty to pay for airfare back to India, where the cost of living is much lower and you could have lived like a prince while studying, with plenty left over for fun (or retirement savings, depending on your temperament).
What do you do now? You can reapply, if you have a really good and documentable explanation that will clear up the credibility hit your previous change of plans produced. At the very least, this explanation should detail why you found it reasonable to stay in the UK, where you lived, how you paid for yourself, most importantly where that money came from (and if the money was given to you by someone, why they would give you that money and where they got it from), as well as all the other minor things the ECO wonders about, such as why you plan a 17-day visit to take a 1-day exam. You'll probably also need to provide some evidence that it is common to do nothing but study for this exam for months and months (especially, since study would be all you did for half a year, if you did not work) and yet fail it multiple times but eventually pass.
It can be difficult for inexperienced applicants to lay out such an explanation in a way that looks convincing to an ECO. You should consider getting professional legal help with it -- meaning a lawyer who specializes in UK immigration cases. That's going to cost you a pretty penny, but if you have the means to live in the UK for half a year without working, it may be a way forward for you.
If your new application is also refused, you should probably accept that you're not getting back into the UK. Scrap your plans and find a career that doesn't depend on needing to do that.