Fresh pineapple contain enzymes which breaks down protein molecules in liquid that would turn into jelly, making them smaller, so they can't tangle up, which stops the jelly setting.
In canned pineapple, due to a change in temperature, the protease enzyme becomes inactivated, and hence it won't break protein molecules of the liquid, allowing them to tangle.