Is there a better way to make a user profile tab using a view?
There isn't any need to use a custom module for this: The Views module already allows you to associate a URL to a view and make the view appears as a menu tab.  

The following screenshots are for Views 7.x-3.x-dev, but the settings are present also in previous versions of the module.
Under "Page settings," there are two options: "Path" and "Menu." The screenshots shows the settings used for a view implemented by a third-party module (the Flag module), whose view is shown as menu tab.