More than an Indian ocean port (which could be blockaded by India in case of a war with either of Pakistan or China), this will connect China by road with Middle East Asia and other Central Asian states; China hopes this connectivity will boost trade in the future.
This project is undertaken with the intent to engage the excess capacity of the engineering firms that have grown and matured over the years with China's economic surge in the last three decades. These companies have the expertise, technology and project management expertise—to build roads, dams, bridges, tunnels, rails, trains, engines, steel, cement and myriad other things—but doesn't have any takers as they had earlier because of the economic slowdown in China.
Another reading is that China has lots of Capital which it can invest abroad but not at home. With the overheated economy at home it is wiser to redeploy it in countries with friendly disposition to Chinese investments.
If all goes well China can get a new avenue for its products. Even if none of it works it is not too bad, as China will get the host governments indebted. Sri Lanka[1], with its Hambantota port project, can be considered as an example.
[1]: http://www.forbes.com/sites/wadeshepard/2016/11/17/sri-lanka...