It's a quirk of the JTable's Scrollable implementation: it sets an arbitrary fixed prefScrollable size.
You null it to make the scrollPane to fall back to using the table's preferredSize:
table.setPreferredScrollableViewportSize(null);
Edit
outch, @vedran is correct, that's not always working in a core table with core layoutManagers (it was a nice hack in another question :) sorry for the confusion. Copying his comment here:
table.setPreferredScrollableViewportSize(table.getPreferredSize());
is a viable option, though all the usual bewares about hard-coding sizes apply here as well.
A well-behaved JTable would implement a more reasonable getPreferredScrollableViewportSize, f.i calculating it in terms of content. JXTable (which is the best-behaved table, biased me :-), you could set the pref in terms of visible rows, just as in a list:
xtable.setVisualRowCount(3);