Jeez, do people still believe this rubbish? It's been nonsense since it was first peddled, but I thought that myth had died out ten years ago.
Google does NOT give any preference to .edu or .gov sites, or any other sites, simply on the basis of their TLD. While it's true that those sites tend to do well in the rankings, that is because they are content-heavy, reputable and have lots of links pointing to them – they would do just as well if they were on a .com, .biz or any other domain. Any .edu or .gov site that is letting spammers build links all over it is going to be treated with the same disregard that Google treats any other site doing the same thing.
Or to put it another way - if it's easy to get a link, that link is pretty much worthless.