Follow up question: why did the Spanish get so little land
I can't answer your primary question, but I can touch on the Spanish.
The Napoleonic wars left Spain weak, divided, and with most of their empire in one degree of revolt or another. Spain spent much of the 19th century consumed with civil wars in Spain itself and additional colonial revolutions.
The Scramble for Africa is usually dated to 1881-1914.
Spain entered the 1880s recovering from their third civil war in 50 years, the Third Carlist War (1872-1876). They were also fighting in Cuba from 1868-1880 in the 10 Year War, and the Little War. So there wasn't a lot of interest in grabbing new territory as the Scramble kicked off. Instead Spain's focus was on restoring internal stability and holding on to existing colonies. As the Scramble kicked into high gear the Spanish were faced with revolutions in Cuba and the Philippines, and then the Spanish American war, where they finally lost most their remaining colonies to independence and the Americans.
To the degree that Spain got involved in the Scramble, it was to protect what was already seen as their zone of influence. They fought in Morocco, in the First Melillian War (1893-1894), Second Melillian War (1909-1910), and third Melillian War (1911-1912). These gained the Spanish some minor territory, but they exhausted the Spanish. The Rif people put up a hardy fight and had access to modern European weaponry. So while the Spanish won they left with thousands of Spanish dead on the fields.
All told Spain spent the Scramble period preoccupied with other maters. A series of pyrrhic victories and costly defeats left them in no appetite for foreign adventure. Plus the specter of yet another Civil War always loomed on the horizon. Although it was held at bay until the 1930s, it was always in the background as a possibility. So the Spanish governments were very conservative with their foreign diplomacy. Military force may be needed at home at any time.
I've explained this as part of teaching gigs many times, but I can't come up with a better source than Blom and Lamberts (ed.), Geschiedenis van de Nederlanden (Amersfoort 2013) 339-340. I don't recommend the book.
Anyway. The short answer is that they didn't have the ability nor the inclination to join the scramble for new colonies worldwide. The Netherlands had greatly declined as a world power since 1700, and despite a brief surge in power, the secession of Belgium made for a meagre power. Besides this, there was a sentiment in the Netherlands of being a neutral country. This can be seen in the construction of the Peace Palace in the Hague and the hosting of multiple peace conferences in that city.
What the Dutch did do was consolidating their power in Indonesia. The Dutch Indies were, before, more of a claimed control than an actual control of territory. To increase their prestige and power, the Dutch were better off strengthening their hold there, in part to make sure no one else could claim land in the area.
So to summarize: The Dutch didn't have the power to gain much land, but did have the power to consolidate their hold on Indonesia, which was a more worthwhile endeavour. Besides that, the Netherlands tried to take the role of a neutral nation. The Dutch Indies were a source of pride, however, so there was the will to strengthen their hold there.
I hope this helps!