It was considered a crime to teach slaves to read and write because they worried that if they could communicate privately, then they may have formed plans to escape. It would have heavily damaged the selling of slaves, and would have also hurt the economy. At that time, much of the economy depended on slave trade for money. If slaves could devise plans to escape with each other secretly, then that would also have made slave masters lose much of their money since slaves were not cheap.
Have a good day! :)