There are probably two primary reasons why this would have been voted opinion-based (not related to whether or not it actually is opinion-based):
At first glance, it appears opinion-based, especially because of the title question, "Why do a lot of websites use 'q' for their search function?" Looking at that in isolation, that can easily be considered opinion-based; it appears to ask a coding style question, and it appears to ask reasons for others' style choices that we have no way of knowing.
Looking at the answers it attracted, while it is undeniably true that "q" is the first letter of "query", there isn't exactly an ISO standard that specifies that "q" must be used for search query parameters. For all we know, Google chose it because it is the first letter of "quit using Bing".
That said, there is a second question in the question text itself, "is there some technical or browser compatibility reason for this?" No matter how good or silly you think that question is, the answer is categorically "no" and that is certainly not opinion-based.
I think the major issue is the title. The question in the title is can be read in a significantly different way from the question in the text itself. If this question's title were edited to ask the more concrete question in the text, it might not be judged so quickly.
There is probably a lesson to be learned about choosing good titles, and phrasing, here, by the way.