I suppose my followup question is, it must be legal to use the ideas, and algorithms in the code then, as opposed to a copypaste, correct?
Ideas are not copyrightable or patentable, and algorithms should not be either. However, in some legal jurisdictions, it is currently possible to patent a software "invention" which in practice is just an algorithm implemented on a computer. (Yes, I know it is illogical ...)
So, the fact that an algorithm is published does not make it entirely safe to use it.
Worse still, asking the paper's authors for permission is not enough to address patent concerns because he/she may not be the patent owner, or even aware of the existence of the patent.
[How can the paper authors not know about the existence of a patent?
If "invention" was patented before the paper authors wrote their paper, and the authors may have not been aware of it. Academics don't do patent searches. It is too hard, too expensive, and simply not expected of them.
The "invention" may have been patented after the paper was published. In theory this should not happen because the paper should be considered as prior art for the "invention", and should render it unpatentable. In practice, the USPTO (in particular) are not diligent in searching for prior art, and often grant patents for "inventions" that are not original.
Anyway, unless an academic paper author is an "inventor" of the patent, there is no reason he or she should be aware of the patent.]
But if you worried about software patents, you'd never write a single program.
I would assume the papers are published/talks given to spread and encourage the use of the ideas within?
An idealist would assume that. In practice, a significant proportion papers are actually written to further the careers of the authors. Large numbers of published papers for academics helps to get promotion / tenure and helps to bring in more research grants. A lot of academics will game the system by publishing stuff of questionable value.