To me, value seems like just an arbitrary concept we attach to things based off of how positively or negatively they currently/eventually will effect us. Since whether or not things can be positive or negative is based on preference, is value also preference based? Does this mean that nothing can have an underlying constant value?
Presuming that he strongest form of your prostitution would be: The Law and general moral code of society is constituted and developed by the transient preference (and prejudice) of the people. It should be evident that while there are certainly examples from history to support your standpoint, contemporary society display obvious signs of other influences.
One such influence may be found in the field of Ethics, or moral philosophy.
Exploring this field should show how particular philosophers have influenced the politics of the time as well as how philosophical schools have at different times steered public opinion and practices of the legal establishment.
Note, your concern could return in another form if stated thus: The philosophy and ethics of the time are shaped by the will and whims of the people.
Georg Simmel's The Philosophy of Money is one of the most thorough developments of a theory of value that I'm aware of. This quote from the Wikipedia article (https://en.wikipedia.org/wiki/The_Philosophy_of_Money) about the book may be helpful:
Simmel believed people created value by making objects, separating themselves from those objects and then trying to overcome that distance. He found that objects that were too close were not considered valuable and objects that were too far away for people to obtain were also not considered valuable. What was also considered in determining value was the scarcity, time, sacrifice, and difficulties involved in getting objects. In the pre-modern era, beginning with bartering, different systems of exchange for goods and services allowed for the existence of incomparable systems of value (land, food, honor, love, etc.). With the advent of a universal currency as an intermediary, these systems became reconcilable, as everything tended to become expressible in a single quantifiable metric: its monetary cost.
One problem with the OPs query concerns use of the word preference. It is not a unidimensional concept as preference has many meanings and usages in fields as diverse as probabilistic choice theory, economics, marketing, philosophy, psychology and more. Richard Thaler, the Nobel Laureate and behavioral economist, describes a human process of mental accounting in which preferences are formed, embedded and used in making decisions. While a useful metaphor, the actual mechanisms of this process of mental accounting are fairly opaque. Add to that the complication that people often falsify their preferences in order to conform with social norms.
Some writers (only Stephen Covey comes to my mind) oppose values and principles. Both are intended to improve the survival of the group.
Values are completely subjective and principles can be considered as objective, common to all. Values are assigned by societies (jewelry, having long ears money, a big big big car, etc.) and they are relative. On the other hand, principles, like loyalty, honesty, fidelity, etc. can be assessed as objectively positive.
Principles, clearly, help improving the group interactions, and might be understood as positive, because they are assessed based on past knowledge. Values are usually more superficial, and can be effectively bad for the group even if the group considers them good.
The line between both of them is hard to assess. Remember that any group makes its best shot to persist, but not all succeed. That means that values assessed as positive can effectively be destructive.