I think pirating educational materials is less morally bad than pirating entertainment.
College textbooks, for example, are insanely expensive. I once paid like $300 for a single chemistry book. I never made that mistake again. Not because I pirated; I just started buying used or past editions. It's not like chemistry for a 100 level class is cutting edge stuff. It's the same ideas and knowledge we've had for decades or a hundred or hundreds of years. It's all public knowledge at this point.
But you may need the book to do readings and assignments. So if you can't afford the book, even used or past editions, then it makes sense to turn to piracy. I would sometimes grab the library reference copy of a textbook and just go crazy with a copy machine. That might technically still be piracy.
Entertainment, on the other hand, isn't really required at all. So to me, that's worse.
That all said, 99% of the stuff I've pirated is entertainment. My immorality is only bounded by the size of my SSDs!