Charlie Kaufman explains it in an (video) interview with Charlie Rose (skip to 21:00):
I don't know... I thought it was funny. It's hard to explain, but I
thought it was funny, but not jokey. Because [John Malkovich] is a serious actor, he
is a great actor, but there is something odd about him and there is
something behind his eyes that you can't see. And I thought that was a
good person for this.
And then I think his name is perfect for the title... when we trying to get the movie made... we didn't know if John was going to do it and Spike [Jonze] and I sort of tried to make a list of other possibilities and there are lots of good actors but nobodys name sounded good in the title... so... it was important for that reason.
As John Malkovich explains in this (video) interview, even though he liked the script from the start, he asked Kaufman
if he would make that movie about someone else, that I would like to direct it and we would produce it.
Only several years after that the movie finally got made.
This is also mentioned on the IMDb trivia page:
John Malkovich was approached about this film several times and loved the script, but he and his production crew felt that another actor would fit the role better.
Malkovich offered to help produce the film, and aid Spike Jonze in any way, but refused to star in it.
Eventually after a couple of years Malkovich's will was worn down and he agreed to star in the film.