Button requires 27px height because of padding for button. You can change it editing theme. If you are using Ambiance theme open /usr/share/themes/Ambiance/gtk-3.0/apps/gnome-panel.css file for editing. Add padding for PanelApplet .button. For example like this:
PanelApplet .button:backdrop,
PanelApplet .button {
-GtkButton-inner-border: 2;
border-image: none;
background-image: -gtk-gradient (linear, left top, left bottom,
from (shade (@dark_bg_color, 1.5)),
to (shade (@dark_bg_color, 1.05)));
border-color: alpha (shade (@dark_bg_color, 1.0), 0.6);
border-left-color: alpha (shade (@dark_bg_color, 1.5), 0.3);
border-radius: 0;
border-width: 0 1px 0 1px;
color: @dark_fg_color;
text-shadow: none;
padding: 2px 5px 2px 5px;
}