I read in a book on World War I that some thinkers thought to push the idea that there was a good Germany - of the great arts and more specifically one embodied by Kant's works, whereas the militaristic, imperial-sided Germany was embodied by Nietzsche's works. Did Nietzsche ultimately end up being viewed negatively during this period (and Kant more positively?)
The short answer: YES! The idea that "the militaristic, imperial-sided Germany was embodied by Nietzsche's works", and later that the works comported with the views of the Nazis absolutely did ol'Freddy no favors (sorry, I kant speak on Kant about this).
To get into the longer views... Nietzsche absolutely got associated with Nazism and his reputation in turn suffered for it. Reworking some earlier stuff I wrote here, to look at how this started, we need to look to Nietzsche's sister. While there has been decades of debate about just what Friedrich would have thought about the Nazis, and it was the conventional wisdom for a time that his works fit mostly within the Nazi worldview, at this point most experts, originating in no small part fron Walter Kaufamann's work to rehabilitate him, will soundly state that his works were co-opted, and the Nazi interpretation is not a fair one. They will instead point to his sister, who (along with her husband) was a deeply avowed anti-Semite, German nationalist, and in her old age, Nazi supporter. Her views, and her marriage, were the direct cause of what Nietzsche himself termed "radical breach between me and my sister", and although they did somewhat patch things up, he remained opposed to the marriage throughout. After he descended into madness, Elisabeth Förster-Nietzsche became the master of his affairs, advanced her own views as being the proper understanding of his work, and in 1901, after he had died, used his notes for an abandoned work to publish "The Will to Power", which she claimed to be his master work, the culmination of his philosophy. Never mind that he had actually abandoned the draft, and reworked it two dozen times after. To quote Kaufmann:
The two most common forms of the Nietzsche legend can thus be traced to his sister. [....] and by bringing to her interpretation of her brother's work the heritage of her late husband [a prominent anti-semite whose ideology Nietzsche has excoriated on many occasions], she prepared the way for the belief that Nietzsche was a proto-Nazi.
Kaufmann certainly isn't grasping at straws here either. The following was intended as a preface to one of the drafts of the Will to Power, and needless to say was not included by his sister when she published her prefered 'cut':
That is is written in German is untimely, to say the least: I wish I had written it in French so that it might not appear to be a confirmation of the aspirations of the German Reich.
Anyways though, Elisabeth did a good job putting her brother's 'legacy' on a new track. Clandestine edits, ugly distorstions, and outright forgeries characterize the publications of his works and correspondence done under his sister's direction during the early 1900s. After World War I, her membership in the German National People's Party ingratiated her within the far-right milieu of German politics of the period, and she lived long enough to be praised and honored by the Nazi Party upon its rise to power, recieving a pension of 300 RM per month from Hitler personally, and being further honored by his attendance at her memorial service when she died in 1935. It wasn't a one woman show though. This reinterpretation of Nietzsche's work as far right, German nationalism, with, if not outright anti-Semitism at least a lack of the anti-antisemitism actually found in his work was further burnished by editors like Alfred Bäumler, whose annotated edition was one of the most widely read in the interwar years, and also was an avowed Nazi. The linking of Nietzsche and Nazism was common enough in the popular mindset that at the Nuremberg Trials, although recognizing that Nazism and Nietzsche's philosophy might not have been one in the same, the connection was nevertheless an obvious one:
Without doubt, the late philosophy of Nietzsche cannot be identified with the brutal simplicity of National Socialism. Nevertheless, National Socialism was wont to glorify Nietzsche as one of its ancestors. And justly so, for he was the first to formulate in a coherent manner criticism of the traditional values of humanism; and also, because his conception of the government of the masses by masters knowing no restraint is a preview of the Nazi regime. Besides, Nietzsche believed in the sovereign race and attributed primacy to Germany, whom he considered endowed with a youthful soul and unquenchable resources.
And that was certainly the image cultivated about Nietzsche, which the Nazi party latched onto, but I would also point back to the unpublished line above, which is only one of many you can find where he has quite the opposite to say in regards to the German spirit. Take what he had to say on the Slavs compared to the Germans:
The Poles I consider the most gifted and gallant among the Slavic peoples; and the giftedness of the Slavs seems greater to me than that of the Germans.
So to get back to where we were earlier, Kaufmann, beginning his work only a few years after the war (Nietzsche: Philosopher, Psychologist, Antichrist was published in 1950) was a very key part in rescuing Nietzsche's legacy from the Nazis, and as we can see, it was quite tied in with them up to that point.
Much of the discussion that Kaufmann covers in Nietzsche about this (the entire 10th chapter, "The Master Race", is devoted mostly to race and Nazism) comes down to perception of race in Nietzsche's writings, and specifically the concept of 'master race', which of course tied in well with the Nazi's own philosophical underpinnings (although it should be noted Nietzsche [seemed to] fit their philosophy, and was not the source of it). But, as Kaufmann points out, Nietzsche writes against nationalism, advocates the 'mixed race' marriages, and is generally quite praiseful of the Jews in this regards, "just as useful and desirable an ingredient as any other national remnant". He certainly had views on race that we would find troubling, but far from being the strain of hateful, racial supremacy of Nazism, it was really more an advocacy of many different races, each with their various characteristics, coming together, intermingling, and leading to his hope of the "European Man" (So... yeah, he wasn't exactly not racist either, just not in the same context as Nazism).
To quote Kaufmann, "it would be cumbersome and pointless to adduce endless examples from Nazi works on Nietzsche to refute them each time by referring to the context of Nietzsche's remarks", but nevertheless, Nazi scholars of Nietzsche, such as Max Oehler or the aforementioned Bäumler, often had to do some serious mental gymnastics to excuse or rationalize the anti-German, pro-Jewish, anti-Nationalist, anti-anti-Semitism (an 'obscenity' in Nietzsche's words), which were numerous, and generally done through taking them out of context, or else subtle editing (as noted before, his sister was much less scrupulous, and not above outright forgery).
So I hope that gives you a little glimpse, but if this is a topic that interests you, I really would recommend you track down a copy of Kaufmann's book, as just reading it will be much better than me trying to make out my indecipherable margin notes that are nearly a decade old! (Amazon has a "look inside", so see if you can get some samples of Chapter 10) The sum of it is that Nietzsche's philosophy often can be troubling, and there is plenty to his that simply can't be excused. He is controversial in his own right, even without the association with Nazism, but that association is very much an unfortunate one that shouldn't be taken as representative of his works, and post-WWII scholars have really worked hard to destroy.
Sources
The Will to Power by Nietzsche, Trans. and Intro. by Walter Kaufmann
The Portable Nietzsche by Nietzsche, Trans. by Walter Kaufmann
Nietzsche: Philosopher, Psychologist, Antichrist by Walter Kaufmann
Nietzsche Is Dead by Meredith Hindley, Humanities July/August 2012 | Volume 33, Number 4