Morality should play a great role in this. Whatever moral values a society holds should go a long way to determining what works of art are shown to the general public.
This is not to say that there should be censorship. The government should not ban "immoral" works of art. However, they should not be placed where they would be seen by members of the public who did not wish to see them. They should be put in rooms where people would have to knowingly want to see them in order to enter.
The reason for this is that public museums are places for members of the general public, not just for art connoisseurs. Members of the public should not be forced to see works that offend them. Those works should surely be available to be viewed by those who want to see them, but they should not be forced upon people who want to enjoy art that is in line with their moral sensibilities.
Whether you're talking about statues, paintings, music or films, the people and institutions that create and produce art have some obligation to give their work a rating (i.e., PG-13, R) in case something may be inappropriate for children. The same idea could be used to categorize the content of art in a museum, segregating the more controversial art to a separate area. This secludes rather than excludes the art.
That being said, there is general consensus on some ideas about morality, but in different cultures and under different governments, there may be disputes. For example, a work of art critical of a certain religion might be considered immoral by the church but it might be considered moral by those who think some aspect of the church's history does not live up to the morals they espouse.
Then the question becomes who has the right to say what is moral: government, the museum, the general public? To secure artistic freedom, the artists themselves would have to find another venue to showcase their work if museums exclude their work. And if the museum does exclude an artist's work, one must ask if the government, church or some other influential institution had something to do with that censorship. And, if so, was this done for the social good or was it done to suppress ideas that threaten the power of influence of those institutions?
Answers to these questions will depend on the museum and the local and national culture. Controversial art does not need to be excluded from the general public, but if the museum is a private institution, it has the right to do so. If controversial art is not excluded, it would be up to those who run the museum to determine whether or not such art should be secluded from the main gallery and if such art should come with a disclaimer similar to how films are rated.
Morality has nothing to do with art. Whether a piece of art generates a response from a viewer that the viewer considers unacceptable to his or her "moral" code has nothing to do with viewing the art. Morality resides in the conscious choices the viewer makes upon any stimulation;in fact, an argument can be made that morality has nothing at all to do with society's choices of any kind. Also, there is no way of guessing what piece of art will "offend" someone in a museum. For example, nudity? For example, offal? For example, violence? For example, abstraction? The museum curator has many other things to worry about than what the public "morality" may or may not approve.