Answering from a football perspective, we enforce the sidelines strictly because the officials who work out there work off the field, or on the sideline itself but they have to have room to move off the field without fear of banging into someone. The advent of the spread offense requires this. When I started calling football as a linesman we were 3-4 yards outside the widest guy and the game was mostly between the hash marks. Five officials could easily cover a varsity game. Huge areas of the field were ignored and there wasn't a QB in the state working on a deep-out pattern.
That all changed, and it did so at the same time that a multi-million dollar lawsuit bankrupted several officials in a game who, by all reports, were DOING THEIR JOB JUST FINE. Oh, and the officials WON the case, but the cost of defense was staggering. At the bottom of this post I'll write what happened, but getting back to the point here, I see coaches on the court at basketball games quite a bit but I haven't seen them get in the way recently. Most schools have the benches so close to the court there is simply no room there.
As to why football officials worry more about their sidelines than the play on the field -- I don't know. My philosophy is to drop a flag an get on with the game. Sideline warnings don't cost a yard, the first time, and they send a message. f the message isn't heard, we'll start walking yardage, but continuing to try to get people back who aren't getting the message is pointless.
If there is an observer there, one of the biggest things in a reports of wing officials is sideline control. As a referee, I also send in a report
to the association and assignor, and if a guy lets coaches or clipboard people into the area he has to work, I'm going to make sure the assignor knows he's not up to the task.
When I work with newer guys I like to be positive, offer constructive criticism and stay upbeat. Rarely do I get angry or show it (and always privately, even then) but this season I had a newer guy who didn't control his sideline and I let him know at halftime that things had to change. Come the second half, I looked over at the start of a play and he was standing next to a coach, laughing about something, a yard on the field. Needless to say, I did not receive a Christmas card from that one this year.
As to the lawsuit: What happened was during a game in Texas, an official ran down the sideline while covering a play and crashed into a coach, also watching the play. It was a freak thing; the coach had a brain injury and had to retire on medical disability.
Here's the real crime -- no one from the school or coach's family sued. No one there thought it was anything other than a bad-luck accident. It was the school system's workman's comp insurance carrier that sued ALL FIVE officials on the game for causing the accident, citing the fact that, among other things, the official was running in the vicinity of the coach, and he was watching the players, not looking at his path.
After that, the NCAA and the NFHS got really uptight about football sidelines and I'm with them on that one.