Apparently its origin isn't clear. Grammarist.com reports:
The idiom on the up and up—whose exact origins are mysterious, though it dates from the late 19th century, is likely American, and appears to come from sports betting—means (1) open and honest, legitimate; and (2) on the rise. Though some dictionaries promote one or the other definition (usually the first), both senses are so widespread that we have to accept them.
The article then provides three citations for the first meaning, dated 1929, 1937, 1938, and one 1949 citation for the latter meaning. Merriam-webster.com says “First Known Use of UP-AND-UP 1863” for the meaning “an honest or respectable course”, but gives no citations. Languagehat.com has numerous comments on the two different meanings, but nothing about etymology; and Geoffrey Nunberg uses “on the up and up” as an example of a phrase that many people use one way, and many another, with people in either group not knowing of the other.