I like to be loved.
I like being loved.
What is the difference between them?
I don't think there's much of a difference at all, since both forms are capable of expressing both an achieved state and an ongoing sense. One could say they differ only in which of those two senses is primary.
"I like to be painted green" said the house.
The house likes to have green paint on it. The house likes it when the painters are painting it green.
"I like being painted green" said the house.
The house likes it when the painters are painting it green. The house likes to have green paint on it.
The shade of difference between them is akin to the difference between
I am loved.
I am being loved.
The former expresses a general condition, the latter - current state (just as it is always the case of Present Indefinite versus Present Continuous).
It is usually acceptable to replace the to-infinitive with a gerund:
I love to ski. = I love skiing. (no difference in meaning)
however, in your case the presence of the passive voice (to be + past participle) makes a tiny difference, barely perceptible. Some, possibly many, would say that the difference is non-existent.
Verbs of preference and non-preference can be followed by gerund or to-infinitive with almost no difference.
These verbs are
to like - I like cooking/I like to cook
to love - I love dancing/to dance
to hate - I hate living in a big city/to live in a big city
After would/should like/love/enjoy/prefer/hate only to-infinitive:
I would like to live in a big city.
The gerund often refers to a general statement ( I like dancing), the to-infinitive can refer to single action (I like to dance when I have guests), but often gerund and to-infinitive are interchangeable.