The OED's first citation for hot water in the sense "trouble" is:
1537 Lisle Papers (P.R.O.) XI. 100 I can get no conserve dishes, for those that my Lady Fitzwilliam hath came out of Levaunt; howbeit, if they be to be had, I will have of them, or it shall cost me hot water.
Cost me hot water seems to have been a set phrase:
1593 G. Peele Edward I it shall cost me hot water but thou shalt be King Edward's man
1640 T. Hooker The Soules Humiliation 38 Nay, the Lord knowes that my corruptions have cost me hot water, my heart hath beene exceedingly vexed with them
1654 E. Gayton Pleasant Notes Upon Don Quixote 79 this same search hath not cost me hot water (as they say)
My speculation: maybe hot water was a canonical example of something troublesome to procure (in the days before hot and cold running water)?