I’m curious on how an ancient civilization was able to flatten entire mountain tops. Has there been any research that concluded why they were built and how?
I'm a little confused by the question. The Nazca lines were made by the Nazca. They're an indigenous people in Peru, and the lines are named for them. So, the who is fairly simple. Are you looking for more about the Nazca? Or are you asking how they were made, or why?
The how is fairly simple: Math, basically. Imagine the scale drawings you might have made in 7th grade or so. You have a model, then simply size it up. The lines themselves are trenches, dug a few feet deep to expose lighter soil and rock below the darker surface. It's creative, but nothing involved is revolutionary.
I'm further unsure about flattening mountaintops. Could you be more specific? Many Andean peoples terraced--they notched 'levels' out of hillsides to create a staircase-like pattern that allowed them to farm on a relatively level surface. Again, this is a practice that while laborious, is common in many parts of the world. Rice paddies in southeast Asia are particularly famous for it.
As far as leveling an entire mountain? To my knowledge, that never occurred.
As others have pointed out, the Nazca didn't flatten any mountains. The region where the lines were made is a flat plain between the mountains to the east and an escarpment that falls down toward the ocean to the west, with the western margin being highly eroded by deep gullys and canyons.
As an example, the specific site seen in this image used in the link you posted elsewhere in this conversation can be seen here on Google maps. You can zoom out to see the larger context, revealing that its not a flattened mountaintop but a plateau at the same level of the rest of the plain, just surrounded by gullys cut out by the local watershed.
Also, in the removed comment chain, you had asked if there were any settlements in the area. The answer is yes. The main Nazca city was Cahuachi, seen here on Google maps.