Louisa Vesterager Jespersen, 24, was killed together with 28-year-old Maren Ueland from Norway, as the two camped overnight at an isolated hiking spot south of Marrakesh while on vacation. Their bodies were found the following day.
Moroccan authorities have said they were beheaded and are calling the crime a “terrorist” act.
Saturday's 45-minute service for Jespersen was held at the Fonnesbæk Church in Ikast, in the Mid Jutland region of Denmark.
Speaking just before Jespersen's casket was carried out of the church, Danish Prime Minister Lars Løkke Rasmussen vowed her life would not be forgotten.
“Though the pain is unbearable, we must not succumb. We must remember who we are, what we are made of, and what we stand for,” he said.
According to tabloid B.T., more than 400 people attended the service in the small, modern church. An adjoining room next to the main hall was opened to accommodate all of the guests.
Moroccan authorities have arrested a total of 22 people in connection with the murders. They include four main suspects and a Spanish-Swiss man who had links to some of the suspects and who subscribed to “extremist ideology”, Moroccan officials say.
The main suspects belonged to a cell inspired by Islamic State group ideology, but none of the four had contact with IS members in Syria or Iraq, Morocco's counter-terror chief Abdelhak Khiam told AFP.
Jespersen and Ueland had been studying outdoor activities and tourism at the University of Southeastern Norway. The pair decided to go to Morocco for Christmas and arrived for a month-long holiday on December 9.
They had travelled to the foothills of Mount Toubkal, North Africa's highest peak, not far from the tourist village of Imlil. Friends have described the two young women as “adventurers” and “sociable”.
“The girls took all the necessary precautions before leaving for the trip,” Maren's mother Irene told Norwegian's NRK television in December.
Ueland's funeral is to be held in Norway on January 21.