A 5-4 ruling cleared states to collect sales tax from online retailers, even if those companies don’t have a physical presence in the state.