Frankenstein references aside, the real name origin is kind of strange. Per Dr Pepper themselves:
Wade Morrison, the drug store owner, named it "Dr. Pepper" after Dr. Charles Pepper, a Virginia doctor who was the father of a girl Morrison was once in love with.