When I create bunkers, I randomly put infantry in it. The only discrimination I make is to put wounded units in the bunker. But should I favor putting marines over marauder? And why?
It depends on what race you're facing and what their army composition is.
Generally though, marines are your best bet as the bunker increases the marine firing range by 1 for a total of 6 (it actually increases range for all units inside by 1).
Marauders are a good choice if they are protoss or zerg and have a lot of stalkers/roaches. The bunker will give you marauders (the hard counter to those types of units) extra hit points and give them more time to deal their extra +damage to armour.
Don't forget, you can stim inside a bunker too.
Put your most important and vulnerable units in the bunker.
- Marines - Have high DPS and are very fragile, usually the best option
- Marauders - Have high HP and are very good vs armored. If you are facing many Stalkers and you have only 1 or 2 Marauder, just put the Marauder in the bunker.
- Ghost - If enemy has High Templar and you still need Mana for EMP, put your Ghost in the Bunker. This way he shoots but cannot get attacked by Feedback.
Otherwise I would put wounded units in the bunker.
When watching pro replays I'm noticing that units are almost never just sit inside a bunker. Then jump there when it is needed and are out to counter attack. And during defense just fill it with someone.
The main strength of bunker is that you are able to fix it with SCVs and there can more then one fixing it. That increases your defense potential significantly. If you see the attack roll at least 4 SCVs right away to your bunkers.