You allowed to choose whatever you want to do until you roll dice. Once you decide to roll dice you're committed. If the shield master ability didn't have an action economy, sure you could do both but since it does, you have to choose.
If you need an explanation on why, a round takes six seconds. In those six seconds, you move, take your bonus action to shield bash if you're a shield master, use you action to take multiple attacks, and use a reaction. You don't get to use infinite bonus actions and reactions just because you have more than one option. It's in the rules under reactions.