I don't see anything illegal about it. It's basically like telling a friend "hey, I'll send you $1000 on Amazon payments. Tomorrow, you send it back to me on Amazon payments and we'll both keep the miles."
There are always tax issues when you create a company. Any profits that the company returns to owners/shareholders may be subject to corporate tax and income tax. This sounds like a lot of hassle to get some miles.