Is it beneficial for a student to publish their research code and data?
The core of scientific research is that we are open on how we came to a certain conclusion. That way we can move beyond "I am wearing a white lab-coat, so you must believe me", to "this is how I got my results, you can replicate them and see if they are robust, or you can try different approaches and we can discuss and learn how that affected the outcome". So making sure others can understand in detail how you got to your results is central to doing good research. Releasing code is an important step in that, regardless of the university you belong to. 

So don't think of this as a service to others (it is nice if that also happens, but that is not the goal). It is about doing good research by documenting how you got to your results, and making that documentation available.