I somehow understand that non-native could (mis)interpret the phrase
好きなだけ as "only things I like", which is not the actual meaning.
For the first sentence, the actual meaning is "to eat as much food as [I] want to eat".
好きなだけ refers to "as much as one like" and doesn't mean "only things I like". The latter may be translated from other similar sentence i.e. 好きな物だけ食べる that is more certain to mean a noun rather than an adjective/adverb in the former.
Then, the complete sentence shall be parsed as below.
For diabetic patients, even delicious food is made available, [the patients] cannot eat as much as [they] want (like) because of the [diabetic diet] restriction.