I learned this from fiction, but it applies to nonfiction too. First of all, books are categorized by what you put in the keywords section in KDP, if they're self-published, or by whatever your publisher put in there if you're not. Let's say you write a book about Perl and cooking. It may outsell pure Perl books because more people like cooking than Perl. It might be a great cooking book but a poor Perl book - or maybe you're lying about the Perl thing, and it's just a cookbook. But it'll top the Perl category as long as Amazon believes you that it's about Perl, and among the Perl books, it will have the highest sales rank.
Unfortunately, what I bet is happening is that this book is legitimately somewhat about Perl, and the author tagged it as such in the keywords. But its sales aren't coming from winning the Perl category alone; they're coming from that and PHP and beginning programming and generally from being ranked in multiple categories.
Your best bet to get your category back is to try to convince Amazon it's not about Perl at all. Good luck - I didn't look close enough to see if that's a reasonable claim or not.