I think it is talking about the church being beautiful to look at, but when you consider why it was built it was for a sad reason.
I don't know the story behind the specific church in the above example, but another example might be if there was a beautiful statue at a grave you might apply the above sentence - The statue is visually beautiful but it was built to remember a loved one someone had lost making it sad to think about.
It is hard to explain but I hope this helps somehow.