My sister who is on a well deserved vacation, mentioned Uluwatu Temple as a beautiful place to visit, so here is what I found:
There is a story about Hindu priest from Java called "Dang Hyang Nirartha" or " Peranda Sakti Wawu Rauh", full of mystical episodes since his arrival until his disappearance in Bali. One of Hindu teaching is the same as other religion that is concerning the world after death or the "here after world " This world is contrasted into two polarization such as Eden garden and hell. For those devotee, a promise of all goodness and happiness are there which is called "sorga" In the tradition of Hindu in Bali it is said that the "sorga" is undescribed by words, and undepicted with picture. Where truth is an absolute, and body is embraced into it, so it only exist " enlightenment". But one can not enter the sorga with worldly body except their holy spirit when he/she during the life had completed duties and behaved as indicated by religious teaching. The other way one can reach sorga by the way called "moksa". It is not quiet clear what is actually meant by the word "moksa". Many assumptions arose. One thought it is a body sublimation, that one who has reach his stage of moksa disappeared in the world without living his/her physical body. This stage can only be reached with a severe body control on senses while developing knowledge by meditation or hermitage. Others thought that when a person dead, their spirit become one with the absolute being, and will not experience rebirth ( Sanskrit : samsara ) anymore. Since life is basically a punishment of sins and misdeeds of their past life ( Sanskrit : Punarbawa ). So, actually based on the last teaching human being during his life is stirred to do the good thing.
Dang Hyang Nirarta is believed the one that have reached such stage, and he accomplished his moksa on a spot of land which is believed to be the sacred place. In this sacred place then was built a temple called Ulu Watu. That was why the place has been considered a very special place by the king in the past. It is not only Uluwatu temple that is associated with Dang Hyang Nirarta, but many temple such as Ponjok Batu at North West Bali, Rambut Siwi in Negara regency and Sila Yukti in East Bali. It is probably the claim from Hindu priest in the past that their role in the society was unquestionable.
Other side of above story, one phenomenon is certain during Balinese history that was during the disintegration of period of Balinese kingdom ca. 16th century to 17th century many small kingdoms tried hard to build their identification to at least same as Klungkung. The foremost one was the temples. Each kingdom would build one sea temple, one city temple, and one mountain temple. There are 8 kingdoms still alive in Bali, when Indonesia announced the declaration of Independence in 1945. Each of this kingdom had their own 3 main temples at the level of smaller social unit such as " Desa " another 3 temples are also built. Uluwatu is belong to Badung kingdom, and until now the owner is one of the palace heirs of Jero Kuta.
In Badung was divided into 2 kingdoms during 17th century, one the bigger is Mengwi kingdom covered almost bigger part of Badung current regency and part of Tabanan regency, even Blambangan regency in east Java which is now Banyuwangi kingdom. Uluwatu was most probably built by Mengwi kingdom as sea temple, at the same time as Ulun Danu as mountain temple. The development of the kingdom later obliged Mengwi kingdom to give Uluwatu temple to Badung kingdom, and Ulun Danu to Tabanan kingdom. Shortly after 1634 AD Mengwi again built other 2 temple, one is Tanah Lot as sea temple, and other is Pucak Mangu temple in Pelaga area as mountain temple.
Today is not only the area of Badung and municipality of Denpasar feel that Uluwatu is their temple or as Bali main temple ( Bali "Sad Kahyangan" ) but other areas of Bali which were different kingdom in the past. The main holder of the temple who daily look after it, and bear the responsibility of the temple maintenance and ceremony is one of the king family in Denpasar, under the regency of Badung.....
(h/t: Bali off the Beaten Track)