It is a strange to read words taken from a biography you have written, but distorted as the basis of a vicious and offensive attack on its subject. This has been my experience since the publication of the ludicrous article by Geoffrey Levy in the Daily Mail on Saturday describing Ralph Miliband, Ed Miliband's father, as "the man who hated Britain".

The sole basis for this assertion was a diary entry at the age of 16 in autumn 1940, where Ralph Miliband wrote that "the Englishman is a rabid nationalist" and, "when you hear the English talk of this war you sometimes almost want them to lose it to show how things are." Such sentiments might sound shocking, but they need to be put into their real context.

A few months earlier Miliband had arrived in Britain with his father, having walked from Brussels to Ostend, where they took the last boat leaving for Britain. While working hard to improve his English, he was also spending much of his time wandering through the streets of London trying to make sense of his new environment. He was in a constant state of anxiety about the fate of his sister and mother, who had remained in Nazi occupied Belgium as stateless Jews.

Because he believed that the earlier appeasement of Hitler was largely responsible for the situation, he was occasionally exasperated by the atmosphere of complacency and superiority amongst the British upper classes, and this no doubt provoked his intemperate diary outburst.

But he was equally fascinated by the remarkable fact, also expressed in his diary, that: "I have never, never heard an English person doubt the English victory."

Yet of far greater importance than either of these adolescent musings was his determination to join the Royal Navy at the earliest possible opportunity and, once engaged in active service after June 1943, how eager he was to play his full part in the defeat of Nazism. Nor did he ever doubt that the victory was vital and, unlike some on the left, he always acknowledged the key role played by Churchill in this respect. After the war he wanted to stay in Britain and one of his first priorities was to ensure that his father was also allowed to remain here and that the family could be reunited.

This was no easy task, given the narrow-minded prejudices of some officials about allowing "alien" immigrants into the country, and it was finally completed only in 1953. But once he was able to relax about this, he devoted himself to building his life here, and this was cemented by his marriage in 1961 to Marion Kozak (another Jewish survivor, who had been hidden in Poland during the war), and the birth of their two sons later in the decade. Subsequently, the only significant amounts of time he spent abroad were in teaching in North American universities, where he went almost every year from the late 1970s until shortly before his death in 1994, and where he usually felt quite homesick.

He clearly had great affection for Britain, despite all his criticisms he voiced about its class structure, and he would devote the majority of his writing and teaching to the analysis of British politics, particularly in such classic works as Parliamentary Socialism (1961) and Capitalist Democracy in Britain (1982). And his own periodic political activity was also in a British context. But we can only understand Miliband's long-term attitude to the country by appreciating within his general outlook.

Levy claims that Harold Laski, his teacher and mentor at LSE, "encouraged his growing interest in Karl Marx". This is highly misleading. In fact, Miliband had already regarded himself as a Marxist at the age of 16, and Laski urged him to consider other influences and to reach his own judgments. Subsequently, Miliband would always seek to reconcile Marxism and democracy because both were equally important to him, and his passionate commitment to democratic values is evident in such works as Marxism and Politics (1977) and his final book, Socialism for a Sceptical Age (1994). Again, while acknowledging that Miliband never justified Stalinist death camps, Levy suggests that he was less than honest in welcoming Mikhail Gorbachev's attempts to democratise Soviet society.

But this is a complete misrepresentation of his position. In fact, he had never joined the Communist party and was already critical of Soviet policies in the early postwar period.

Certainly, in the early 1960s he hoped that the USSR might eventually evolve into a more democratic system, but the Soviet-led invasion of Czechoslovakia in 1968 finally crushed any optimism on this score. After this he always insisted that democracy was an integral part of socialism, and he pronounced his verdict on the collapse of the east European regimes as follows: "The simple fact of the matter is that capitalist democracy, for all its crippling limitations, has been immeasurably less oppressive and a lot more democratic than any communist regime, whatever the latter's achievements in economic, social and other fields.

Of course he also deplored the fact that this also led to a general expansion of neoliberal capitalism and the weakening of all forms of socialism, but he was totally honest in welcoming the end of communist regimes that he regarded as indifferent to humane values.

For Ralph Miliband's most fundamental characteristic was his absolute integrity. He always sought to probe deeply beneath surface appearances so as to understand the meaning and significance of historical developments. Writing his biography was one of my most stimulating experiences as a researcher, for I was able to read numerous letters and drafts of manuscripts in which he tested and refined his ideas in dialogue with others. I also interviewed so many people who knew him well – including several who disagreed with him politically – who testified to his transparent honesty. In sharp contrast with Levy's article in the Mail, his aim was always to achieve the highest level of analysis of which he was capable, rather than to make cheap political points through traducing the ideas of his opponents. When he criticised existing institutions, it was not because "he hated Britain", but because he wanted, above all, to see it transformed into a society imbued with socialist values and practices.

But, of course, Levy's real target is not Ralph Miliband at all, but Ed, whom he accuses of being determined to bring about his father's vision. Apart from being absurd, this is also ironic for, ever since my biography was published, I have constantly been asked to explain how both of Ralph's sons became politicians in a party that he had often regarded as a barrier to the attainment of socialism. In fact, Ed Miliband has pinpointed both the differences and the continuities between himself and his father very convincingly in an interview with Charles Moore in the Daily Telegraph last year. The differences, he noted, were that Ralph believed that the notion of "responsible capitalism" was a contradiction in terms, while he wanted to save capitalism from itself by making it "more decent, more humane, more fraternal". But there are also some striking continuities in Ed's insistence that socialism is "a set of values" and that "while there's capitalism, there'll be socialism, because there is always a response to injustice".

Of course, the right might not want to be reminded that capitalism leads to injustice, but they need to confront the arguments seriously rather than to carry out character assassinations of either the father or the son.

Michael Newman is an emeritus professor at London Metropolitan University and author of Ralph Miliband and the Politics of the New Left (Merlin Press, 2002)