It is not enough to pay your entire tax amount, you have to pay it over the course of the year. The income tax in the US is a pay-as-you-go system.
If you would have withheld Maryland taxes during the year, you likely would have avoided the underpayment penalty. But I understand that sometimes this doesn't happen.
And unlike the federal income tax, where you are excused the underpayment penalty if your tax due is less than $1,000, for Maryland, you are excused only if the tax due is $500 or less.
Please see the Maryland 502UP form to get an idea.
**Mark the post that answers your question by clicking on "Mark as Best Answer"