Whether a Ph.D. is good or bad for your career depends on a lot of things, like your country, your subject area, and your non-academical abilities and interests. In science and engineering a Ph.D. can open up the path to research and development, and any Ph.D. can be helpful to instill trust in clients, e.g. as a lawyer or broker. On the other hand doing a Ph.D. can be seen as procrastinating, i.e. people believe that you rather stay in academia then get a "real job". This is probably a problem in parts of humanities, or if your previous education or your Ph.D. took significantly more time then necessary. On the other other hand this won"t be a problem if your future employee is related to your studies, e.g. when working for a publishing company.
The fact that you are not sure whether you want to stay in academia is not important, since doing a Ph.D. serves to find out whether you actually like research or not. So succesfully doing a Ph.D. and then leaving, even if a Postdoc position is on offer is quite common and nothing to be frowned upon.