Sotheby's opened bidding for the 9.54-carat "Fancy Deep Blue" at $19m (£13m) and closed at $22m (£15m), which was below the ring's reserve price.
It had been estimated to be worth up to $35m (£24m).
Temple, who made her screen debut aged three, was one of Hollywood's biggest stars in the 1930s. She died in 2014 at the age of 85.
The ring was bought by the actress's father for $7,210 (£5,016) in 1940, around the time of her 12th birthday.
It was being auctioned by a private seller who bought it from her estate.
Despite the item failing to sell, Sotheby's said it remained "fully confident" it would find a buyer.
"Unfortunately, tonight wasn't its night in the salesroom," it said. "The Shirley Temple Blue Diamond is an exceptional stone in quality, rarity and provenance. It has been an honour to share its story with collectors, connoisseurs and Temple's loyal fans over the past few months."
The actress's films were credited with boosting American morale during the Depression and keeping her studio, 20th Century Fox, from going under.
But she failed to make the transition from child star to adult roles and after leaving the world of entertainment she reinvented herself as a politician.
She went on to be a US representative to the United Nations and the first woman to be US chief of protocol, during Gerald Ford's administration.
She also served as US ambassador to Ghana and Czechoslovakia in the final year of the Cold War.
Shirley Temple's rare blue diamond ring has failed to sell at a New York auction.