1. People always imagine the future to have machines that are magically helpful.

2. People always imagine the future to have "the" machines that are magically helpful.
-----------------------------
Are both okay? Do we have to use 'the' or not in this sentence? What is the difference between the two sentences in meaning?

There's no real difference in meaning between the two sentences, but you don't need "the" -- it's an extra word you can skip!