Laws which significantly increase penalties for people who obstruct a public place have passed Parliament during a marathon overnight sitting.