Preheat oven to 400°. Cut beets into cubes. Toss with oil, salt and pepper, and roast 30 minutes, until tender. Reduce temperature to 375°.
Cut tempeh into cubes. In a skillet or nonstick frying pan, add oil and cook onions and mushrooms until tender. Add tempeh, and cook until browned. Add tamari, onion powder, garlic powder, paprika, cumin, thyme and chia seeds. Stir to evenly coat. Remove from heat, and allow to cool.
Combine tempeh mix with quinoa, oats, walnuts and ¾ cup lentils. Mix well.
In a food processor, combine cashews, beets, egg replacer and remaining lentils. Pulse until only little pieces of beet and lentils are visible. Add to tempeh mix. Adjust seasoning to taste.
Moderately grease a loaf pan with oil, and fill with tempeh mixture, packing down to fill any gaps. Evenly spread ketchup on top. Bake 50 minutes.