There’s a psychiatrist called Dr. Ashley Kafka at the Ravencroft Institute in the comics:
I think this is the simplest explanation for the movie character’s name (although I haven’t read any Franz Kafka, so maybe there were some references I didn’t spot).
And @Keen has found a fascinating Vanity Fair interview which claims that the comics character was originally named after a fairly distant relative of Franz Kafka, therapeutic hypnotist Frayda Kafka:
So at one point along the way the legendary comic-book writer J.M. DeMatteis walks in your door.
Yes...he said he wanted to go to a hypnotist, for creative purposes to help with his writing and research. But he wanted a hypnotist who was a Baba lover. Somebody gave him my card. He doesn’t remember who. But he carried my card for years. Then one day we met at a meeting and he recognized my name and pulled the card out of his pocket.
So you are absolutely the inspiration of Spider-Man’s Dr. Kafka, right? He told you beforehand?
Yes, he said he was thinking of doing it, and I was thrilled. You know, why not?