I guess that \subcaption uses \unskip to remove the space cause by the line break, but hyperref adds some internal code which stops \unskip to go that far back. Because the \rule is \textwidth long the space is creating a new line if not removed. Alternatively add a manual \unskip before \subcaption if you have a more complicated content than \rule.

In general it is a good idea to place a % after } and { at the end of a source line. Such spurious spaces are appearing often if you are not careful.

In my document where this problem occurs (it's only in one subfigure - in all other subfigures there is no gap), I had to use both \unskip and place a % after the figure code. Anyhow, the gap is now gone. Thanks.
–
gablinOct 18 '11 at 13:42