The reason why you put the code into a function in the first place is to be able to execute that code without having to copy-paste the same piece of code over and over.
You can call the function from anywhere in your script.
That means that you most likely want to do different things with the output of the function.
If you make the function print the output directly, you have very little control over how it outputs the data. If you have 5 different uses for the output, the function must have 5 different ways of printing the data, which gets messy.
If the function returns the value, you can put the output formatting in the script, and keep your function clean.
Ofcourse, it's different for every function, but many functions are better off returning output than printing it.