Seems kind of an odd thing to think about, but where did the Dutch get the engineers for this job? Were they military engineers, or civilians? Did they import expertise from abroad, or self-sufficient when it came to canal-building?
By the time the swampy lands near the Amstel river (which Amsterdam derives its name from) were settled, other swampy lands in the Netherlands, which is largely a water logged land, were already established. The Dutch already had experience with building canals for the sake of controlling water flow, experience building polders, experience using windmills to pump water, etc. So the Amsterdam canals, which were not started as the glorious canals you see today, were built by Dutch civil engineers who were already well experienced and knowledgeable in the design and construction of canals.
You're probably more insterested in the Netherlands in general, not only in Amsterdam, if asking about the origins of the canals.
As for why, it's because it's waterlogged. When I lived there, I learned it's a very constant process to pump the land dry, even today. They take apart large swaths of road, bring large pumps, suck water out for days, then reassemble the road and move on to another section.
If you've ever wondered why the houses are all slanted in the center, it's the same thing. Soft earth, because of the water, which causes the building foundations to slowly shift.
Even the apartment my wife's parents own in a building built in the 70s is already beginning to lean.
It's swamp lands, basically.