Are they primary membergroups, or aditional membergroups?
In Themes/<your theme name>/index.template.php, find your shop button code. It will look a little like this:
//Begin SMFShop code
echo ($current_action == 'shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'shop' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=shop">Shop</a>
</td>' , $current_action == 'shop' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
//END SMFShop code
(search for ?action=shop to find it)
Right above the "echo" bit (in this case, it's directly below the // Begin SMFShop code line), add this:
global $user_info;
// Groups to hide the shop button from.
$shop_disabled_groups = array(1, 2, 3);
// Only show the button if they're not in any of these groups.
if (!in_array($shop_disabled_groups, $user_info['groups']))
Change the "1" to the ID of the group you want to hide the button from. In the "Membergroups" section of the admin panel, clicking the "Modify" link will show the ID in your browser's address bar (eg. ?action=membergroups;sa=edit;group=4).