Well, in the examples that you gave, it might have been because that is just how they wanted to be known.
However, in the cases like that of J.K. Rowling or S.E. Hinton, it is because they are female authors, and the publishers feel that it is better for them to use initials or a pen name because it is more likely that the book will appeal to a bigger audience, especially male readers, who are more likely to read their books if they don't know the author is a woman, because they might think that a woman is not really capable of writing that type of book (kind of sexist, but that's the truth).
Or it could just be that they feel that a short name like that will stick better and be remembered more easily than if they have their full name on the book.
So it depends.