A lot of this is dependent on class. As a Vanguard for example, you'll probably never want to use an Assault Rifle - they're just too heavy, and as a Soldier, you'll usually give SMG's a pass - everything they can do an AR does better. Meanwhile, an Infiltrator gets lots of bonuses when using their trusty Sniper Rifle, evening if irresponsibly shooting it from the hip.
The second consideration is range: at very long ranges, a Sniper Rifle offers top notch accuracy. AR's and Pistols Can be pretty good. SMG's can be flaky though, and shotguns are nigh useless. By contrast, Shotgubs ate devastating at short range, but the loss of peripheral vision while looking down that sniper scope can get you killed.
The next consideration is the defenses of your opponents. Slow firing, high caliber weapons like Sniper Rifles and Pistols chew through Armor, but are weak against Biotic Barriers and Shields. Rapid fire weapons with a lot of projectiles, by contrast, like SMG's and Shotguns chew up Shields and Barriers quickly, but have trouble with armor. Assault Rufles are a bit of an odd duck as they're 'pretty good' at handling everything.
Additionally there are mods availiable for several weapon types that alter their capabilities. You can add Armor-penetration to an SMG or a shotgun, or a melee upgrade to a pistol or shotgun. Maybe a scope on your SMG to improve its mid-long range performance?
Finally, you may want to pair some weapons up with certain specialty ammo. For instance, SMG's are devestating in combination with Cryo or Incendiary Ammo as their high rate of fire gives them more opportunities to proc the special effects provided by these ammo types than, say, a slow firing shotgun.
Yes, squad members benefit from the weapon master upgrade. Remember though that the squad bonus skill grants squad members that ammo at only 50% effectiveness. Therefore squad members ammo increases by 20%, not 40%.
The Bioware math explanation can be found here.
Best Answer
You're no specifically penalised, you just do miss out of the damage bonus that a sniper rifle would have against an armoured target.
If you look at this wiki page for the first sniper rifle (the Mantis) you can see it has a ×1.5 damage multiplier against armoured foes and unmodified damage (×1.0) for shields and barriers, as is the case for most of the sniper rifles.
An SMG (for example) would be the other way around, normally with a ×1.5 multiplier against shields and barriers, but unmodified damage (×1.0) against armour.
If you want to think in raw numbers (and assuming your SMG and sniper have identical DPS including reload times) you are therefore losing 33% (×1.5 → ×1.0) of your damage against an armoured foe when using most SMGs compared to most sniper rifles.