Robert Hendrickson, The Facts on File Encyclopedia of Word and Phrase Origins (1997) has this assessment of piggy bank:
piggy bank. Though piggy bank's popularity over the years probably has something to do with the pig's supposed greediness, the main reason the child's bank is called a piggy bank is simply because so many of the banks are made in the shape of pigs. They have been made in such shapes since at least 1909, though the first recorded use of the term piggy bank is in 1945.
Early Google Books matches for 'piggy bank'
The earliest Google Books match for "piggy bank" is Dairy Stephenson, "For Auld Lang Syne," in The Christian Register (August 5, 1920):
This argument silenced the little girl like magic. As she hopped along in the dust she hugged the thought of her pennies and nickels, safe in the piggy-bank.
The second is Katherine von der Lin, The Way of the World (1921):
In the evening the Woman worked on the caps and flowers; in the daytime she would sell them. ... How different they felt as they climbed the hill to deliver some of their orders, which resulted in a nice visit and many friendships were formed in this way. On one such trip Ronile was given a small amount of money and sh had a dozen places for it. First the Piggy Bank, which for so long had been empty, an she felt that to make the Piggy satisfied it would have to have money in its belly.
But the next are from 1941, when a whole swarm of matches appear in the search results. I should note an oddity: The Traveller's Malay Pronouncing Hand-book eleventh edition (1917, the first edition evidently was published in 1886) has the following untranslated Malay phrases:
Bahwah soorat eeny piggy Bank Blan-dah
Piggy Bank tookar note eeny am-bil ring-git
Piggy Bank tookar ring-git eeny am-bil skilling
But elsewhere the handbook notes that piggy (or pergi) can mean "go away," so these instances of "piggy Bank" are presumably just coincidental.
The 'Pete Pig Bank'
On significant antecedent of "piggy bank" may have been the "Pete" pig bank—a charity movement for the relief of lepers in the 1910s. From "For the Soldier Leper and Others," in The Continent (March 20, 1919):
Perhaps you have heard the story of Wilbur and his pig. Wilbur, a Kansas boy, was much interested when his church raised $225 to support nine lepers for a year in one of the mission stations. When some one gave Wilbur three silver dollars, he bought a little pig, saying he would sell him for money enough to support a tenth—a leper's child. The Sunday school and everybody in the town became interested, and everybody brought an ear of corn or a pail of swill to feed the pig Pete. And sure enough, Wilbur sold Pete for enough to support a little Siamese leper boy.
When that story was told at a meeting in the Sunday School Times office in Philadelphia. an arrangement was made to get another kind of pig—“Pete No. 2." a pig bank that was fed “coin in the back" instead of “corn in the ear." They say there are over 4,000 of these banks being fed now.
You can see an advertisement for a "Pete Pig Bank" in the July 1917 issue of The Nurse: A Journal of Practical Knowledge.
Earlier matches for 'pig bank'
However, pig bank goes back significantly farther than the Pete Pig Bank movement. From Sophie Swett, "The Twins' Seventy-five Cents," in Primary Education (1904):
He [Uncle James] took out two silver pieces, a half dollar and a quarter.
"What do you do with money?" asked Uncle James.
"Put it into my pig," aid Caddy.
"Into my red apple," said Lizzie. And then both sighed. The pig was a bank made of tin and so was the red apple. Caddy's cousin, James Henry, who was a big boy almost fourteen, had given her the pig because—oh, dear! because she was a little bit greedy. Aunt Mary said, at first, that he shouldn't give it to her, that it was too bad to hurt her feelings, but afterwards she said perhaps it would do her good.
It didn't hurt Caddy's feelings much to have the pig bank given her. Caddy was very plump, with red cheeks and a little pug nose, and she almost always had a good time. It did hurt Caddy's feelings to put her pennies into the bank instead of spending them for candy.
A note in Good Housekeeping (April 1904) suggests that "pig bank" and "piggy" were sometimes used interchangeably even then:
When we were married I felt that more money was spent for cigars than my husband realized, so he agreed to give me a nickel for each cigar he smoked. I bought a china pig bank at the five-and-ten-cent store and each night I presented piggy to my husband, for his supper, as we called it. In a comparatively short time the bank could hold no more, and after guessing what amount we should find, we cracked our faithful piggy, and now I have seven dollars to show for my experiment.
The later arrival of 'capitalist pig'
I also ran a Google Books search for "capitalist pig" to see whether that term might have influenced "pig bank," but the first two quotations are from the 1920s. From The Plebs (1923) [snippet view]:
When, however, one capitalist pig got stuck both our authors criticised the people who really ended the grunting—but there, logic is often not a strong point in Labour Party policies and pamphlets.
And from European Economic and Political Survey (1925), quoting Nikolai Bukharin:
"Here lies the chief danger... But we hope that our Communist god—that is the entire Communist Party—will not allow the capitalist pig to eat up the framework of the socialist edifice..."