The aardvark is called a pig twice over, once in its own name and once in English translation, and it is not a pig.
The word comes from the Dutch spoken by settlers at the Cape of Good Hope. Aarde meant "earth" and vark meant "pig," so the animal was an "earth pig." Etymonline says the name was given because the animal burrows. The Dictionary of South African English describes a burrowing, ant-eating mammal that is active at night, with a long, tapering snout.
English writers used the name, and translated it, before it settled in its modern spelling. The Dictionary of South African English quotes a 1786 English version of Anders Sparrman's travels at the Cape. It mentions "the aard-varken, or earth-pig." A 1796 translation of François Le Vaillant calls it "erd-verken (earth hog)." Etymonline dates "aardvark" in English to 1833.
There is a small spelling twist. The Dictionary of South African English gives the modern Afrikaans form as erdvark. The English spelling, with its double "a," keeps the Dutch aarde.
The second half of the name has old relatives in English. Etymonline traces vark to Middle Dutch varken, "small pig," and further back to a root meaning "young pig." The same root gave German Ferkel, "piglet," and English farrow.
The scientific name tells the same story more accurately. Wikipedia explains that Orycteropus means "burrowing foot" and that afer refers to Africa. The animal also went by "antbear" and "earth-hog," according to the Dictionary of South African English.
As for the pig, the resemblance is only skin deep. The aardvark belongs to a group of African mammals that includes elephants, manatees and hyraxes. Wikipedia lists elephant shrews, tenrecs and golden moles as its closest living relatives.