The femininity of countries, or "motherlands," is partially a reference to the rich and nurturing soil of which they are composed, or "Mother Earth." There is also a linguistic basis for the phenomenon.
Although English is gender neutral and has no feminine and masculine distinctions between words, it is descended from Latin, which does. The Latin phrase for earth or ground is "terra firma," which is feminine. Hence, the planet is often referred to as "Mother Earth" and not "Father Earth."
Germany is the only country that has referred to itself in the masculine. During World War II, it was known as the "Vaterland," which, although gender neutral, is literally translated as "Fatherland."