Although he did not adhere to the Aventine Secession against Benito Mussolini he was part of the opposition in the courtroom and resigned as vice president in December 1926.
After the armistice of Cassibile of September 1943, Gasparotto was part of a committee of anti-fascists that tried to organize, without success, the defense of Milan against the Germans.
His son Leopoldo became an Italian resistance movement leader, but was captured by the Germans in December 1943 and killed in Fossoli on 22 June 1944.
At the end of World War II in 1945, he was called to the National Council and from December 1945 to July 1946 he was Minister for Post-War Assistance in the First De Gasperi government.
Elected Deputy to the Constituent Assembly in June 1946 for the National Democratic Union, he was the first Italian Minister of Defence, created by the merger of three ministries (War, Navy, and Air Force) under the Third De Gasperi government (February – May 1947).