What is the official purpose of having to declare you're carrying more that $20K into Thailand?

Anybody know?

Plus, I was reminded just the other day that a farang cannot buy a house (I suspect it's actually the land you cannot buy?) so I guess it must have been some condo type arrangement the guy was hoping to finance in cash.

Or am I wrong (again)?